[Django] #30819: Locales that are by default set to use two digits year will show invalid year on date picker UI

16 views
Skip to first unread message

Django

unread,
Sep 30, 2019, 7:47:00 AM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
--------------------------------------------+----------------------------
Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Keywords: datepicker
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
--------------------------------------------+----------------------------
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:
[[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
b2IJpYETpd46g/view?usp=sharing)]]

Instead of showing year 2019, it shows year 1919.

My workaround for this problem is to use 4 digits year for that locale by
configuring FORMATE_MODULE_PATH.

However, it is quite clear that there is a bug in the datepicker display.

--
Ticket URL: <https://code.djangoproject.com/ticket/30819>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 30, 2019, 7:55:53 AM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
----------------------------------+--------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution:

Keywords: datepicker | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Changes (by Aldian Fazrihady):

* Attachment "Screenshot from 2019-09-30 18-36-39.png" added.

screenshot

Django

unread,
Sep 30, 2019, 7:57:12 AM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
----------------------------------+--------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution:

Keywords: datepicker | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Description changed by Aldian Fazrihady:

Old description:

> 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:
> [[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
> b2IJpYETpd46g/view?usp=sharing)]]
>
> Instead of showing year 2019, it shows year 1919.
>
> My workaround for this problem is to use 4 digits year for that locale by
> configuring FORMATE_MODULE_PATH.
>
> However, it is quite clear that there is a bug in the datepicker display.

New description:

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:
[[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
b2IJpYETpd46g/view?usp=sharing)]]

Instead of showing year 2019, it shows year 1919.

If I changed the locale to `en`, the datepicker will display the correct
year (2019).

Therefore, my workaround for this problem is to use 4 digits year for that
locale by configuring FORMATE_MODULE_PATH.

However, it is quite clear that there is a bug in the datepicker display.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:1>

Django

unread,
Sep 30, 2019, 7:42:14 PM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
----------------------------------+--------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution:

Keywords: datepicker | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Description changed by Aldian Fazrihady:

Old description:

> 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:
> [[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
> b2IJpYETpd46g/view?usp=sharing)]]
>
> Instead of showing year 2019, it shows year 1919.

> If I changed the locale to `en`, the datepicker will display the correct
> year (2019).
>

> Therefore, my workaround for this problem is to use 4 digits year for


> that locale by configuring FORMATE_MODULE_PATH.
>
> However, it is quite clear that there is a bug in the datepicker display.

New description:

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:
[[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
b2IJpYETpd46g/view?usp=sharing)]]

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 FORMATE_MODULE_PATH. Now datepicker shows the
correct year.

However, it is quite clear that there is a bug in the datepicker display

that happens when two digits year format is used.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:2>

Django

unread,
Sep 30, 2019, 7:48:05 PM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
----------------------------------+--------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution:

Keywords: datepicker | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Description changed by Aldian Fazrihady:

Old description:

> 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:
> [[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
> b2IJpYETpd46g/view?usp=sharing)]]
>
> 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 FORMATE_MODULE_PATH. Now datepicker shows the


> correct year.
>
> However, it is quite clear that there is a bug in the datepicker display
> that happens when two digits year format is used.

New description:

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:
[[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
b2IJpYETpd46g/view?usp=sharing)]]

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.

However, it is quite clear that there is a bug in the datepicker display
that happens when two digits year format is used.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:3>

Django

unread,
Sep 30, 2019, 7:49:01 PM9/30/19
to django-...@googlegroups.com
#30819: Locales that are by default set to use two digits year will show invalid
year on date picker UI
----------------------------------+--------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution:

Keywords: datepicker | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
----------------------------------+--------------------------------------
Description changed by Aldian Fazrihady:

Old description:

> 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:
> [[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
> b2IJpYETpd46g/view?usp=sharing)]]
>
> 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.
>


> However, it is quite clear that there is a bug in the datepicker display
> that happens when two digits year format is used.

New description:

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:
[[Image(https://drive.google.com/file/d/17KEkY89TqimwJIJ0kz-
b2IJpYETpd46g/view?usp=sharing)]]

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:4>

Django

unread,
Oct 1, 2019, 1:09:36 AM10/1/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
--------------------------------------+------------------------------------

Reporter: Aldian Fazrihady | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 3.0
Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by felixxm):

* ui_ux: 1 => 0
* component: contrib.admin => Internationalization
* version: 2.2 => 3.0
* stage: Unreviewed => Accepted


Comment:

I agree we should prioritize date formats with 4-digits year in `id`
locales, e.g.
{{{
diff --git a/django/conf/locale/id/formats.py
b/django/conf/locale/id/formats.py
index 1458230c28..de2d1535ff 100644
--- a/django/conf/locale/id/formats.py
+++ b/django/conf/locale/id/formats.py
@@ -14,8 +14,8 @@ FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see https://docs.python.org/library/datetime.html#strftime-strptime-
behavior
DATE_INPUT_FORMATS = [
- '%d-%m-%y', '%d/%m/%y', # '25-10-09', 25/10/09'
'%d-%m-%Y', '%d/%m/%Y', # '25-10-2009', 25/10/2009'
+ '%d-%m-%y', '%d/%m/%y', # '25-10-09', 25/10/09'
'%d %b %Y', # '25 Oct 2006',
'%d %B %Y', # '25 October 2006'
]
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:5>

Django

unread,
Oct 1, 2019, 2:11:20 AM10/1/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Aldian
| Fazrihady
Type: Bug | Status: assigned
Component: | Version: 3.0
Internationalization |

Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aldian Fazrihady):

* status: new => assigned
* owner: nobody => Aldian Fazrihady


--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:6>

Django

unread,
Oct 8, 2019, 4:11:47 AM10/8/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Aldian
| Fazrihady
Type: Bug | Status: assigned
Component: | Version: 3.0
Internationalization |
Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:7>

Django

unread,
Oct 11, 2019, 2:22:40 PM10/11/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Aldian
| Fazrihady
Type: Bug | Status: assigned
Component: | Version: 3.0
Internationalization |
Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aldian Fazrihady):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:8>

Django

unread,
Oct 15, 2019, 2:46:11 AM10/15/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Aldian
| Fazrihady
Type: Bug | Status: assigned
Component: contrib.admin | Version: master

Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1
* version: 3.0 => master
* component: Internationalization => contrib.admin
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:9>

Django

unread,
Dec 23, 2019, 11:42:21 AM12/23/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Farhaan
| Bukhsh

Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Farhaan Bukhsh):

* owner: Aldian Fazrihady => Farhaan Bukhsh
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:10>

Django

unread,
Dec 30, 2019, 8:31:23 AM12/30/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Farhaan
| Bukhsh
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: datepicker | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"550357771b592568399eda08556bb2a749da69fe" 55035777]:
{{{
#!CommitTicketReference repository=""
revision="550357771b592568399eda08556bb2a749da69fe"
Refs #30819 -- Prioritized the date format with four-digit year for the
Indonesian (id) locale.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:11>

Django

unread,
Dec 30, 2019, 8:31:25 AM12/30/19
to django-...@googlegroups.com
#30819: Locales that prioritize 2-digit years shows invalid year in admin date
picker.
-------------------------------------+-------------------------------------
Reporter: Aldian Fazrihady | Owner: Farhaan
| Bukhsh
Type: Bug | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed

Keywords: datepicker | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"cf5d4701dc12ad69d51042b0d7e81e4a54de4bd7" cf5d4701]:
{{{
#!CommitTicketReference repository=""
revision="cf5d4701dc12ad69d51042b0d7e81e4a54de4bd7"
Fixed #30819 -- Fixed year determination in admin calendar widget for two-
digit years.

Two-digit years in the range of [00, 68] are in the current century,
while [69,99] are in the previous century, according to the Open Group
Specification.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30819#comment:12>

Reply all
Reply to author
Forward
0 new messages