-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Doesn't add day #329
Comments
@LexSwed I can't reproduce this issue |
I'm getting this exact same issue. Maybe has something to do with daylight savings. From googling "sunday 28th october clocks":
Can confirm that this bug occurs every year on last Sunday of October. And I'd guess that same error would occur on the last Sunday of march if subtracting a day from the first Monday of March. |
The following is a very hackie solution. But it works for now until this is fixed.
nkFn.dtm.trimDate is just a custom function to make hours/mins/seconds = 0 |
@LexSwed, you need to consider the fact, that Your case is similar to #262, #249 and #74. When you constructed the dayjs('2018-10-28') you assumed, that it works like a "date-only" instance. After adding 1 day, you expected it to become like dayjs('2018-10-28T00:00:00Z') It means, that you have a full date+time object. Both 2018-10-28 01:00:00 GMT+01:00 (CET) Depending on DST changes in your local time zone, adding or subtracting a day may result in an hour shift, which may affect your day value. If you want to prevent it, you need to use setters with |
I like dayjs quite a bit. But had to move to Luxon to feel confident there wasn't something buggie going on every year on last Sunday of October. |
@nukuuk @LexSwed You may could try v1.7.7 and check if this issue is fixed in your timezone. THX. |
Version:1.7.5
Wasn't reproducible on version 1.6.x (don't remember now)
Similar issue to: #262
Trying to add day to 28 of October 2018 doesn't add anything:
https://codepen.io/lexswed/pen/NLaRZY
The text was updated successfully, but these errors were encountered: