React-dates: Daylight saving time in Brazil and duplicated October 15

Created on 16 Oct 2017  路  4Comments  路  Source: airbnb/react-dates

Hey,

Selecting October 15 or 16 in America/Sao_Paulo timezone gives me duplicated days:

peek 2017-10-16 14-35

This is a new issue originally reported by @felquis in #55.

bug

Most helpful comment

Oh jokes it's only when selected. That's really weird!

All 4 comments

Alright, at airbnb.com you cannot reproduce it because day 15 is out of range.

But are two October 16s visible?

Oh jokes it's only when selected. That's really weird!

The real problem is with endOf function of moment. At Oct 15th, the endOf was pointing to GMT 2:59:59. At Oct 16th, the start was GMT 2:00:00. So there was an hour that, according to moment, belongs to two days, when it should belong only to Oct 16th. Fixed it making the endOf of Oct 15th be one millisecond before the start of Oct 16th.

https://github.com/pagarme/pilot/commit/78afd202d4de593e62376ba4aef0f5992fa735b8

Was this page helpful?
0 / 5 - 0 ratings