Option to set input format for dates (type=input.DATE) #237
quadratecode
started this conversation in
Feature request
Replies: 1 comment 4 replies
-
Yeah, the date input format in pywebio will use the language preference setting since it just uses the As a workaround, you can use text input to get date: import datetime
date = input('Birthday', placeholder='MM-DD-YYYY')
date = datetime.datetime.strptime(date, '%m-%d-%Y')
put_text(date) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I am not mistaken, currently the date input format solely depends on the language preference set in the browser with no option to customize it. However, which date format a user is accustomed to probably depends mostly on the country where they reside. This leads to confusion when e.g. someone from Germany (date format: DD.MM.YYYY) has to use the US format (MM.DD.YYYY) just because they have set their browser language to English.
Is there a way to set the date format which I missed? And if not would it be possible to implement this option?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions