Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(test): NETWORKDAYS test TZ-independent with noon timestamps

The NETWORKDAYS test used midnight-only date strings which caused
getDay() to return different values in UTC vs local timezones.
Use T12:00:00 timestamps to ensure consistent day-of-week parsing
across all timezones.

+4 -2
+4 -2
tests/formulas-edge-cases.test.ts
··· 1236 1236 }); 1237 1237 1238 1238 it('handles reasonable date range', () => { 1239 - // Jan 1 (Sun) to Jan 5 (Thu): Mon-Thu = 4 workdays 1240 - expect(evalWith('NETWORKDAYS("2024-01-01","2024-01-05")')).toBe(4); 1239 + // Use noon timestamps to avoid TZ-dependent day-of-week shifts 1240 + // Jan 8 (Mon) to Jan 12 (Fri) 2024 = 5 workdays 1241 + const result = evalWith('NETWORKDAYS("2024-01-08T12:00:00","2024-01-12T12:00:00")'); 1242 + expect(result).toBe(5); 1241 1243 }); 1242 1244 1243 1245 it('caps excessively large date ranges', () => {