-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue #1637: setDay with weekStartsOn != 0 #1639
Conversation
🙏 @dcousens : can you approve this PR since the change has been taken into consideration?
|
@boomdev : have you checked if "lastDayOfWeek startOfWeek differenceInCalendarWeeks" are fixed? |
@trollepierre I am not a maintainer, I am merely a fellow user wanting to help 👍 |
@trollepierre I have not. |
Thank you @boomdev and @dcousens, this seems GTG. |
As demonstrated in the issue, setDay(date, day, [option]) returns an incorrect value if date is on a Sunday and option.weekStartsOn is != 0. This includes a fix (there's probably a nicer way to code this) and 2 corresponding test cases. I also found 4 test cases that I believe to be incorrect, all using the argument {weekStartsOn: 1}. I hope I'm not mistaken here, but I changed the test cases accordingly. - All tests completed - Build script run - Added entry to Unreleased section of CHANGELOG
0920734
to
9d528ab
Compare
@dkozickis yeah, some tests were failing because of a DST issue that was fixed in master. I've rebased the branch but there's still a couple failing tests in the changed function. I'm on it. |
Co-authored-by: Sasha Koss <koss@nocorp.me>
As demonstrated in the issue, setDay(date, day, [option]) returns an
incorrect value if date is on a Sunday and option.weekStartsOn is != 0.
This includes a fix (there's probably a nicer way to code this) and
2 corresponding test cases.
I also found 4 test cases that I believe to be incorrect, all using
the argument {weekStartsOn: 1}. I hope I'm not mistaken here, but I
changed the test cases accordingly.
All tests completed
Build script run
Added entry to Unreleased section of CHANGELOG