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] Toolbar components are not using the set timezone #13319

Closed
ghaerdi opened this issue May 30, 2024 · 8 comments · Fixed by #13481
Closed

[pickers] Toolbar components are not using the set timezone #13319

ghaerdi opened this issue May 30, 2024 · 8 comments · Fixed by #13481
Assignees
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

@ghaerdi
Copy link

ghaerdi commented May 30, 2024

Steps to reproduce

Link to live example: (required)
https://mui.com/x/react-date-pickers/timezone/

Steps:

  1. Go to https://mui.com/x/react-date-pickers/timezone/
  2. Inspect page and Toggle device toolbar to simulate a mobile device
  3. Scroll the overview sections where are the following two inputs
    image
  4. Select one of these inputs to open the time picker.
  5. Select a time

Current behavior

The displayed time in the time picker it's not the same as selected
In the next screenshot I selected 10 but it's showing 2.
image

Expected behavior

The displayed time in the time picker should be exactly the same as selected.

Context

The current behavior it's confusing for the end user. I thought the issue was in my project only but I found the same issue in the documentation.

Your environment

No response

Search keywords: TimePicker timezone responsive mobile pad ipad

@ghaerdi ghaerdi added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 30, 2024
@ghaerdi ghaerdi changed the title TimePicker with timezone seems buggy i na mobile/pad device platform TimePicker with timezone seems buggy in a mobile/pad device platform May 30, 2024
@michelengelen
Copy link
Member

@ghaerdi thanks for opening this issue here.
I can confirm this. It does not happen when using the renderTimeViewClock renderer, so it likely is a bug with the MobileTimePicker component.

@LukasTy didn't we have an issue somewhere related to this already?

@michelengelen michelengelen added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! component: time picker 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 May 31, 2024
@michelengelen michelengelen changed the title TimePicker with timezone seems buggy in a mobile/pad device platform [pickers][MobileTimePicker] usage with timezone seems buggy May 31, 2024
@michelengelen
Copy link
Member

Just tested it with the MobileTimePicker component. And it is indeed only happening there.

@LukasTy
Copy link
Member

LukasTy commented May 31, 2024

LukasTy didn't we have an issue somewhere related to this already?

I vaguely remember seeing something similar, but I couldn't find the issue. 🙈

On the problem itself—it's the Toolbar components that are broken.
TimeClock represents the time correctly, but TimePickerToolbar, DateTimePickerToolbar, as well as DateTimeRangePickerToolbar fail to use the timezone.

The issue is clear and needs to be addressed. Thank you for reporting @ghaerdi 🙏

@LukasTy LukasTy added time-zone Issues about time zone management and removed component: time picker This is the name of the generic UI component, not the React module! labels May 31, 2024
@LukasTy LukasTy changed the title [pickers][MobileTimePicker] usage with timezone seems buggy [pickers] Toolbar components are not using the set timezone May 31, 2024
@ghaerdi
Copy link
Author

ghaerdi commented May 31, 2024

Didn't expect a quick response, thank you all. Looking forward when this is resolved

@Hawkhub
Copy link

Hawkhub commented Jun 14, 2024

Any temporary workaround coming to your mind? I couldn't figure a way to pass timezone prop to MobileTimePicker exclusively from the TimePicker level. But that seems to be a bad solution anyways, cause of the interfering in the TimePicker component logic

@LukasTy
Copy link
Member

LukasTy commented Jun 14, 2024

@Hawkhub I'm not sure if there is any quick workaround here.
The only thing would be to rebuild the Toolbar component with timezone support and pass it to the toolbar slot.

I'll spend some time exploring solutions to see how difficult the fix is. 😉

@flaviendelangle flaviendelangle self-assigned this Jun 14, 2024
@flaviendelangle
Copy link
Member

@LukasTy I just saw your message, I'm testing a solution 😆

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.

@ghaerdi: 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
5 participants