I noticed that we were getting inaccurate results from weekOf for the week when daylight savings changed just recently. Usually we get the previous Sunday for any date during the week, but for some reason we were getting the previous Saturday instead, only last week though.
✓ Jiffy - startOf 2023-03-07
✓ Jiffy - startOf 2023-03-12
Expected: 'Mar 12'
Actual: 'Mar 11'
Which: is different.
Expected: Mar 12
Actual: Mar 11
^
Differ at offset 5
✖ Jiffy - startOf 2023-03-13
Expected: 'Mar 12'
Actual: 'Mar 11'
Which: is different.
Expected: Mar 12
Actual: Mar 11
^
Differ at offset 5
✖ Jiffy - startOf 2023-03-14
Expected: 'Mar 12'
Actual: 'Mar 11'
Which: is different.
Expected: Mar 12
Actual: Mar 11
^
Differ at offset 5
✖ Jiffy - startOf 2023-03-18
✓ Jiffy - startOf 2023-03-20
What is the expected behavior
I'd expect all of those tests to pass. If you notice, the only date that gets the correct start week for the week of the 3/12 is on 3/12 itself, that returns 3/12 as expected, but all other dates that week return 3/11 instead.
Describe the bug
I noticed that we were getting inaccurate results from weekOf for the week when daylight savings changed just recently. Usually we get the previous Sunday for any date during the week, but for some reason we were getting the previous Saturday instead, only last week though.
How to reproduce the bug
here's the result:
What is the expected behavior
I'd expect all of those tests to pass. If you notice, the only date that gets the correct start week for the week of the 3/12 is on 3/12 itself, that returns 3/12 as expected, but all other dates that week return 3/11 instead.
Tested using Jiffy version 6.1.0