Opened 5 years ago

Last modified 5 years ago

#30819 closed Bug

Locales that are by default set to use two digits year will show invalid year on date picker UI — at Version 4

Reported by: Aldian Fazrihady Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords: datepicker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Aldian Fazrihady)

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:
https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-b2IJpYETpd46g/view

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 (5)

by Aldian Fazrihady, 5 years ago

screenshot

comment:1 by Aldian Fazrihady, 5 years ago

Description: modified (diff)

comment:2 by Aldian Fazrihady, 5 years ago

Description: modified (diff)

comment:3 by Aldian Fazrihady, 5 years ago

Description: modified (diff)

comment:4 by Aldian Fazrihady, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top