react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Daylight savings duplicates date display in some countries

Open antoniopro7 opened this issue 1 year ago • 0 comments

On September 7th, 2023, the timezone for America/Santiago (Santiago, Chile) adjusted for daylight saving time at midnight. When DST starts, clocks are set forward by one hour at midnight. This means that 24:00 (end of day) on the day before DST becomes 01:00 on the DST day, effectively skipping an entire hour.

So, on September 7th, when DST kicked in:

Midnight at the end of September 7th (24:00) instantly turned into 01:00 on September 7th. This means the hour from 00:00 to 00:59 on September 8th never existed in local time! The impact of this is seen when generating a list of dates for a calendar month, as all times are set to Midnight by default. If you’re in the Santiago timezone and create a new date for midnight on September 7th, that date doesn’t exist. This results in two September 7th dates, as shown below.

This is a duplicate from https://github.com/wix/react-native-calendars/issues/2321 and I know it's related to Hermes but I'm wondering if someone else who has faced this issue has found any workaround.

image

antoniopro7 avatar Aug 07 '24 22:08 antoniopro7