Locales that prioritize 2-digit years shows invalid year in admin date picker.
I am using id
locale. Somehow, on that locale, the django admin uses two digits year to be displayed in input fields.
The datepicker UI will display this wrong year:
Instead of showing year 2019, it shows year 1919.
If I changed the locale to en
, the datepicker will display the correct year (2019). I also noticed that en
by default uses 4 digits year in input fields.
Therefore, my workaround for this problem is to use 4 digits year for that locale by configuring FORMAT_MODULE_PATH. Now datepicker shows the correct year on id
locale.
However, it is quite clear that there is a bug in the datepicker display that happens when two digits year format is used.
Change History
(13)
Description: |
modified (diff)
|
Description: |
modified (diff)
|
Description: |
modified (diff)
|
Description: |
modified (diff)
|
Component: |
contrib.admin → Internationalization
|
Summary: |
Locales that are by default set to use two digits year will show invalid year on date picker UI → Locales that prioritize 2-digit years shows invalid year in admin date picker.
|
Triage Stage: |
Unreviewed → Accepted
|
UI/UX: |
unset
|
Version: |
2.2 → 3.0
|
Owner: |
changed from nobody to Aldian Fazrihady
|
Status: |
new → assigned
|
Component: |
Internationalization → contrib.admin
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Version: |
3.0 → master
|
Needs tests: |
unset
|
Owner: |
changed from Aldian Fazrihady to Farhaan Bukhsh
|
Patch needs improvement: |
unset
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
screenshot