Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime input field shows incorrect time while the dropdown/modal is accurate #7388

Open
1 of 2 tasks
intigratech opened this issue Jan 21, 2025 · 0 comments
Open
1 of 2 tasks
Labels
help wanted Contributions from community are welcome

Comments

@intigratech
Copy link

intigratech commented Jan 21, 2025

Dependencies check up

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

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

7.15.0

What package has an issue?

@mantine/dates

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

The issue can be seen on https://mantine.dev/dates/dates-provider/#date-format-considerations
The input field shows a time - for example: 02/10/2000 12:40 which doesn't match the timezone set on the datesprovider. However, the modal/dropdown to input the time shows a different timezone, presumably based on the timezone provided in the datesprovider.

import { DatesProvider, DateTimePicker } from '@mantine/dates';

function Demo() {
  return (
    <DatesProvider settings={{ timezone: 'America/New_York' }}>
      <DateTimePicker label="Pick a Date" placeholder="Pick a Date" defaultValue={new Date('2000-10-03 02:10:00Z')} />
    </DatesProvider>
  );
}

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

https://mantine.dev/dates/dates-provider/#date-format-considerations

Possible fix

The input field and modal/dropdown must respect the timezone provided.

Self-service

  • I would be willing to implement a fix for this issue
@rtivital rtivital added the help wanted Contributions from community are welcome label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions from community are welcome
Projects
None yet
Development

No branches or pull requests

2 participants