mantine icon indicating copy to clipboard operation
mantine copied to clipboard

DateInput flickers the wrong date when used with timezones.

Open jhitchins88 opened this issue 1 year ago • 1 comments

Dependencies check up

  • [X] I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.10.1

What package has an issue?

@mantine/dates

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

When using DateInput as a controlled input and using a timezone, the displayed date will flicker to your localized time before switching to the timezone provided. The time value is correct and does not change, merely the displayed date.

I was able to reproduce this in a sandbox and in my local mantine storybook.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/dateinput-timezone-issue-ywwqtq?file=%2Fsrc%2FApp.tsx

Possible fix

Not 100% sure. One way would be to set the input to use the provided timezone, or prevent it from changing the provided value.

Self-service

  • [X] I would be willing to implement a fix for this issue

jhitchins88 avatar Jun 04 '24 15:06 jhitchins88

You are welcome to research the issue and send a PR with the fix.

rtivital avatar Jun 13 '24 05:06 rtivital

Hello @rtivital! I opened a PR with fix. Ready for review.

Sergio16T avatar Jul 12 '24 23:07 Sergio16T