[Django] #29109: `undefined` show in auto generated datetime input or time input in form when using locale as `th`

4 views
Skip to first unread message

Django

unread,
Feb 3, 2018, 12:10:13 AM2/3/18
to django-...@googlegroups.com
#29109: `undefined` show in auto generated datetime input or time input in form
when using locale as `th`
-------------------------------------+-------------------------------------
Reporter: Napat | Owner: nobody
Charoenlarpkul |
Type: Bug | Status: new
Component: | Version: 1.11
Internationalization | Keywords: form datetime thai
Severity: Normal | locale
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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

{{{
#!python
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
]
}}}

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

Django

unread,
Feb 3, 2018, 3:58:57 AM2/3/18
to django-...@googlegroups.com
#29109: `undefined` show in auto generated datetime input or time input in form
when using locale as `th`
-------------------------------------+-------------------------------------
Reporter: Napat | Owner: nobody
Charoenlarpkul |
Type: Bug | Status: new
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: form datetime thai | Triage Stage:
locale | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manatsawin Hanmongkolchai):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Feb 3, 2018, 4:17:58 AM2/3/18
to django-...@googlegroups.com
#29109: `undefined` show in auto generated datetime input or time input in form
when using locale as `th`
-------------------------------------+-------------------------------------
Reporter: Napat | Owner:
Charoenlarpkul | Manatsawin Hanmongkolchai
Type: Bug | Status: assigned

Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: form datetime thai | Triage Stage:
locale | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Manatsawin Hanmongkolchai):

* status: new => assigned
* cc: Manatsawin Hanmongkolchai (added)
* owner: nobody => Manatsawin Hanmongkolchai


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

Django

unread,
Feb 3, 2018, 3:22:17 PM2/3/18
to django-...@googlegroups.com
#29109: `undefined` show in auto-generated datetime/time input in admin form for
Thai locale

-------------------------------------+-------------------------------------
Reporter: Napat | Owner:
Charoenlarpkul | Manatsawin Hanmongkolchai
Type: Bug | Status: assigned
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution:
Keywords: form datetime thai | Triage Stage: Accepted
locale |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted
* needs_tests: 0 => 1


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

Django

unread,
Feb 10, 2018, 4:06:01 PM2/10/18
to django-...@googlegroups.com
#29109: `undefined` show in auto-generated datetime/time input in admin form for
Thai locale
-------------------------------------+-------------------------------------
Reporter: Napat | Owner:
Charoenlarpkul | Manatsawin Hanmongkolchai
Type: Bug | Status: closed
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: form datetime thai | Triage Stage: Accepted
locale |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"1a1264f1494976c562c7cb832fe47f3e1e765b8f" 1a1264f1]:
{{{
#!CommitTicketReference repository=""
revision="1a1264f1494976c562c7cb832fe47f3e1e765b8f"
Fixed #29109 -- Fixed the admin time picker widget for the Thai locale.
}}}

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

Django

unread,
Feb 10, 2018, 4:07:31 PM2/10/18
to django-...@googlegroups.com
#29109: `undefined` show in auto-generated datetime/time input in admin form for
Thai locale
-------------------------------------+-------------------------------------
Reporter: Napat | Owner:
Charoenlarpkul | Manatsawin Hanmongkolchai
Type: Bug | Status: closed
Component: | Version: 1.11
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: form datetime thai | Triage Stage: Accepted
locale |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a1286b5a64bc56c3e33e53ffac0eefce76f3efdb" a1286b5a]:
{{{
#!CommitTicketReference repository=""
revision="a1286b5a64bc56c3e33e53ffac0eefce76f3efdb"
[2.0.x] Fixed #29109 -- Fixed the admin time picker widget for the Thai
locale.

Backport of 1a1264f1494976c562c7cb832fe47f3e1e765b8f from master
}}}

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

Reply all
Reply to author
Forward
0 new messages