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

Datepicker does not use inputFormat settings with allowFreeInput #131

Closed
bufsim opened this issue Dec 31, 2022 · 3 comments
Closed

Datepicker does not use inputFormat settings with allowFreeInput #131

bufsim opened this issue Dec 31, 2022 · 3 comments

Comments

@bufsim
Copy link

bufsim commented Dec 31, 2022

works only if i insert a date as MM/DD/YYYY or set inputFormat='YYYY-MM-DD'

code example below

scripts = [
"https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.8/dayjs.min.js",
"https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.8/locale/it.min.js",
]
app = Dash(name, external_scripts=scripts)

app.layout =dmc.DatePicker(
id="it-date-picker",
label="data",
allowFreeInput=True,
inputFormat='DD/MM/YYYY',
locale="it",
style={"width": 200},
)

@snehilvj
Copy link
Owner

snehilvj commented Jan 2, 2023

sorry, I'm not able to understand the problem, can you please elaborate? Thanks.

@bufsim
Copy link
Author

bufsim commented Jan 2, 2023

I apologize if I was unclear. With the datepicker set as I wrote above, if I enter the date using the keyboard it is not entered according to the DD/MM/YYYY format. MM/DD/YYYY is entered.
as example, if i write 26/09/1972 and press enter in the field is written 01/02/2001. If i write 02/03/2020, in the field is written 03/02/2020

@snehilvj
Copy link
Owner

snehilvj commented Mar 1, 2023

Understood now. It's a bug in Mantine v5 but has been fixed in one of the v6 alphas, so it will be available to dmc users when dmc is migrated to use Mantine v6.

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

2 participants