ui icon indicating copy to clipboard operation
ui copied to clipboard

Date picker is 1 day off.

Open Arsh1a opened this issue 1 year ago • 2 comments

If I pick a date, the value that I'm getting from the date picker is 1 day off. e.g: I choose January 18th, 2024. The value that I'm getting is "2024-01-17T20:00:00.000Z". Screenshot 2024-01-23 192522

Arsh1a avatar Jan 23 '24 15:01 Arsh1a

It seems the string is a UTC time, which is correct to me.

chungweileong94 avatar Jan 24 '24 06:01 chungweileong94

Hi @Arsh1a, as @chungweileong94 suggested, the submitted date value is in UTC format. You can see it by yourself by creating a new Date object in JavaScript:

const date = new Date("2024-01-16T23:00:00.000Z") // This contains the date based off your time zone

dan5py avatar Jan 25 '24 12:01 dan5py

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 16 '24 23:02 shadcn