datepicker
datepicker copied to clipboard
Strange behavior of the time picker (time duplication) when you select March 31 and then March 30
Hi, while using this great library, I noticed a strange behavior of the time picker.
- pick March 31
- pick March 30
- We can see time duplication
Haven't noticed this with any other dates
Hey @OrestMaryniuk thanks for submitting this.
I'm a bit confused with this issue, but it turns out that this is a JS Date glitch.
new Date(2024, 2, 31, 0, 179)
will give you Sun Mar 31 2024 02:59:00 GMT+0200
new Date(2024, 2, 31, 0, 180)
will give you Sun Mar 31 2024 04:00:00 GMT+0200
I will think about how to change the time logic to avoid this, and also I can't find any other date with this issue
And it is specific to 2024.
UPDATED: it is related to daylight saving time so 3PM is not exist in your region and you can't pick it 🤷 .