You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I may have found an issue: if I invoke the endOf('day') multiple times I would expect the date to remain the same, but apparently this is not the case during (some) DST transitions:
Well, there's a transition in this time zone on this day at midnight. 1979-05-27T00:00:00+01:00 => 1979-05-27T01:00:00+02:00. See here also.
However, there still looks to be a bug. It's more clearly demonstrated this way:
varm=moment.tz('1979-05-27','YYYY-M-D','Europe/Rome');m.format();// "1979-05-27T01:00:00+02:00" (correct)m.endOf('day');m.format();// "1979-05-28T00:59:59+02:00" (incorrect, should be "1979-05-27T23:59:59+02:00")
This appears to be due to the implementation of endOf in moment. To calculate the end of the day, it does the start of the day, plus one day, less one millisecond. That logic fails when the day doesn't start at midnight. I'll log this in the moment issue tracker, as it needs to be fixed there.
I think I may have found an issue: if I invoke the endOf('day') multiple times I would expect the date to remain the same, but apparently this is not the case during (some) DST transitions:
Did I get something wrong? In this very case it actually goes to the end of the following day. It does not seem to happen with dates after the 1979.
The text was updated successfully, but these errors were encountered: