grommet icon indicating copy to clipboard operation
grommet copied to clipboard

DateInput: Not valid value - example 14/10/2023 retune 13/10/2023T22:00

Open biapar opened this issue 2 years ago • 3 comments

This bug is still here. I use the version 2.32.0. If I choose 14/10/2023 the returned value is 13/10/2023T22:00:00.000Z How to solve?

https://github.com/grommet/grommet/issues/6421

biapar avatar May 22 '23 13:05 biapar

Hey @biapar can you share a codesandbox example that replicates the issue? Also it would be helpful to know what timezone you are working in. Thanks!

jcfilben avatar Jun 02 '23 20:06 jcfilben

mydate: dayjs().utc(true).toISOString(), is the start assignment

then in onChange function : values.mydate = dayjs(values.mydate) .utc(true) .toISOString();

I've a -1 day If I direct read the field value. I'm in Italy.

biapar avatar Jun 05 '23 13:06 biapar

Ran into the same issue. Looks like a workaround is to reformat the initial date to remove any time or timezone information from the string, e.g.: moment(values.mydate).utc().format('YYYY-MM-DD')

nicola-sorace avatar Feb 28 '24 09:02 nicola-sorace