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

[pickers] DatePicker displays empty calendar with minDate in future and timezone UTC #14453

Closed
alex-hrb-0 opened this issue Sep 2, 2024 · 6 comments · Fixed by #12321
Closed
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! time-zone Issues about time zone management

Comments

@alex-hrb-0
Copy link

alex-hrb-0 commented Sep 2, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/zsyzzx

Steps:

  1. DatePicker + dayjs. No default value, no initail value.
  2. Set timezone="UTC" and minDate to future (at least tomorrow)
  3. Open calendar

Current behavior

The calendar is empty, literally:
image
The future months as well

Expected behavior

image

Context

I'm trying to use DatePicker with timezone="UTC" and minDate. Sometimes I have minDate with value in the future.

Your environment

No response

Search keywords: DatePicker, minDate, timezone

Search keywords:

@alex-hrb-0 alex-hrb-0 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 2, 2024
@mnajdova mnajdova transferred this issue from mui/material-ui Sep 2, 2024
@noraleonte
Copy link
Contributor

Hey @alex-hrb-0 👋
Thanks for raising this 🙏 I double checked and it seems you are right. When the timezone is set and minDate is a future date, the calendar does not display correctly. This only seems to be the case when there is no value set 🤔 I am adding this to the board to discuss & prioritize with the team 🛩️

@noraleonte noraleonte added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 2, 2024
@noraleonte noraleonte changed the title DatePicker displays empty calendar with minDate in future and timezone UTC [pickers] DatePicker displays empty calendar with minDate in future and timezone UTC Sep 2, 2024
@michelengelen
Copy link
Member

Hey @alex-hrb-0 ... this is a duplicate of #13875 and #9653.
The dayjs package seems to be broken (iamkun/dayjs#2303)
Thanks for opening anyways.

@michelengelen michelengelen added the duplicate This issue or pull request already exists label Sep 2, 2024
@alex-hrb-0
Copy link
Author

@noraleonte, @michelengelen,
Thank you guys for the reply

Hey @alex-hrb-0 ... this is a duplicate of #13875 and #9653. The dayjs package seems to be broken (iamkun/dayjs#2303) Thanks for opening anyways.

Yeah, I thought the same until I tried other DateTime libs. It works only with date-fns which is basically functions for native JS Date type. I updated the sandbox example as well.

@michelengelen
Copy link
Member

Thanks for the update @alex-hrb-0 ... seems like we marked this as a duplicate preemptively.
I'll re-add this to the board. 👍🏼

@michelengelen michelengelen removed the duplicate This issue or pull request already exists label Sep 3, 2024
@alex-hrb-0
Copy link
Author

@michelengelen,
I made a mistake in my test example: I left timezone="UTC" in a generic component wrapper so it used dayjs approach for setting UTC for DatePicker for all tested time libraries. I retested it again: it works perfectly fine with luxon. I didn't figure out how to set up UTC with moment w\o initial value. With date-fns it's impossible to set up UTC at all.

So luxon is the way out for me. And it feels that you were right about problems in dayjs package.

@LukasTy LukasTy added the time-zone Issues about time zone management label Sep 9, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@alex-hrb-0 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! time-zone Issues about time zone management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants