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

DateTimePicker inconsistent time format 24h vs 12h format in Firefox #4294

Closed
fbucek opened this issue May 24, 2023 · 4 comments
Closed

DateTimePicker inconsistent time format 24h vs 12h format in Firefox #4294

fbucek opened this issue May 24, 2023 · 4 comments

Comments

@fbucek
Copy link

fbucek commented May 24, 2023

What package has an issue

@mantine/core

Describe the bug

I cannot change format for TimeInput, but problem is that it does not work as expected and time format differs in Firefox

21:57 vs 09:57 PM

Main example: https://mantine.dev/dates/date-time-picker/

image

Would be nice to have posibility to force 24 or 12h format.

Often application are developed in one language only so automatic change base on localization can only cause problem.

What version of @mantine/hooks page do you have in package.json?

6.0.11

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@rtivital
Copy link
Member

DateTimePicker uses TimeInput component under the hood. TimeInput component is a native input[type="time"] – its format is based on user system language (as far as I know, this behavior cannot be changed). Formatted value of DateTimePicker can be changed with valueFormat prop – https://mantine.dev/dates/date-time-picker/#value-format

@fbucek
Copy link
Author

fbucek commented May 24, 2023

Thanks for clariication. So only option for me is to create custom component, which wont use input[type="time"].
I would expect that both shown times are in 24 format or both in AM/PM or possible to change both, but DateTimePicker can change only part using valueFormat.

So problem is that time input using some kind of native implementation which is browser dependend and other is using different implementation which is browser independent.

@rtivital
Copy link
Member

You can also try changing value format based on user locale

@guvenaltunsoyy
Copy link

Why does not support custom time formatter or rendering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants