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

DatePickerInput is off by one day when using timezone #5840

Closed
1 of 2 tasks
mlarcher opened this issue Feb 28, 2024 · 5 comments · Fixed by #5916
Closed
1 of 2 tasks

DatePickerInput is off by one day when using timezone #5840

mlarcher opened this issue Feb 28, 2024 · 5 comments · Fixed by #5916
Labels
help wanted Contributions from community are welcome

Comments

@mlarcher
Copy link

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.5.0

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

since v7.5.0, picking a date in the DatePickerInput ends up showing and saving a date one day after the one we picked.

Not sure exactly what is happening there... it might be dur to an interaction with mantine forms.

version 7.4.2 is working fine, something broke when upgrading to 7.5.0

Here are the relevant parts of the setup we have:

// in _app.js
import dayjs from 'dayjs';
import 'dayjs/locale/fr';
import localizedFormat from 'dayjs/plugin/localizedFormat';

dayjs.extend(localizedFormat);

// ...

    <MantineProvider>
        <DatesProvider settings={{ locale:'fr', firstDayOfWeek: 1, timezone: 'UTC' }}>

                    <DatePickerInput valueFormat={'LL'} locale={'fr'} {...form.getInputProps('startDate')}/>

        </DatesProvider>
      </MantineProvider>

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

No response

Possible fix

No response

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 Feb 28, 2024
@rtivital
Copy link
Member

Help wanted with this issue, I'm not planning to work on it.

@karlpablo
Copy link

I had the same issue and am looking into this.

@mlarcher
Copy link
Author

mlarcher commented Mar 4, 2024

Glad to read that. That's kind of a blocker here but I didn't have time to dig intoit yet, and it seems it might become tough if even @rtivital won't look into it 😅

@1g0rrr
Copy link
Contributor

1g0rrr commented Mar 5, 2024

@rtivital Hi!
I was able to reproduce the issude.
Can I deal with it and implement a fix for it?

@rtivital
Copy link
Member

rtivital commented Mar 5, 2024

You are welcome to submit a PR with a fix

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

Successfully merging a pull request may close this issue.

4 participants