#29109 closed Bug (fixed)
`undefined` show in auto-generated datetime/time input in admin form for Thai locale
Reported by: | Napat Charoenlarpkul | Owned by: | Manatsawin Hanmongkolchai |
---|---|---|---|
Component: | Internationalization | Version: | 1.11 |
Severity: | Normal | Keywords: | form datetime thai locale |
Cc: | manatsawin@…, Manatsawin Hanmongkolchai | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I found wrong datetime format order in django/conf/locale/th/formats.py
In TIME_INPUT_FORMATS
and DATETIME_INPUT_FORMATS
, the first order should be
'%H:%M:%S', # 14:30:59
and '%d/%m/%Y %H:%M:%S', # 25/10/2006 14:30:59
The final code should be like this
TIME_INPUT_FORMATS = [ '%H:%M:%S', # 14:30:59 '%H:%M:%S.%f', # 14:30:59.000200 '%H:%M', # 14:30 ] DATETIME_INPUT_FORMATS = [ '%d/%m/%Y %H:%M:%S', # 25/10/2006 14:30:59 '%d/%m/%Y %H:%M:%S.%f', # 25/10/2006 14:30:59.000200 '%d/%m/%Y %H:%M', # 25/10/2006 14:30 ]
Change History (5)
comment:1 by , 7 years ago
Has patch: | set |
---|
comment:2 by , 7 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 7 years ago
Needs tests: | set |
---|---|
Summary: | `undefined` show in auto generated datetime input or time input in form when using locale as `th` → `undefined` show in auto-generated datetime/time input in admin form for Thai locale |
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
The submitter discussed with me (last editor of the file) via email. Apparently,
DateTimeShortcut.js
does not support%f
and so prioritizing those formats break admin functionalities.https://github.com/django/django/pull/9656