Changes between Initial Version and Version 2 of Ticket #28090
- Timestamp:
- 04/20/17 12:15:31 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28090
-
Property
Status
changed from
new
toclosed
- Property Cc ygan@… added
-
Property
Component
changed from
Uncategorized
toForms
-
Property
Summary
changed from
TimeField rendering in admin forms
toTimeField's value incorrectly localized in forms
-
Property
Resolution
changed from
to
duplicate
-
Property
Triage Stage
changed from
Unreviewed
toAccepted
-
Property
Status
changed from
-
Ticket #28090 – Description
initial v2 1 When passing a datetime.Time instance to the choices parameter in a TimeField, the admin template converts it to a human readable form. Eg Time(0, 0) gets converted to "midnight", Time(1, 30) gets converted to 1:30 a.m. In Django 1.10it gets formatted as 00:00:00 and 01:30:00 respectively.1 When passing a `datetime.time` instance to the choices parameter in a `TimeField`, the admin template converts it to a human readable form. For example, `time(0, 0)` is converted to "midnight", `time(1, 30)` is converted to 1:30 a.m. In Django 1.10, it gets formatted as 00:00:00 and 01:30:00 respectively. 2 2 3 3 An example of the choices I pass in to the constructor is: … … 5 5 {{{ 6 6 [ 7 (datetime. Time(0, 0), '00:00'),8 (datetime. Time(0, 30), '00:30'),9 (datetime. Time(1, 0), '01:00'),7 (datetime.time(0, 0), '00:00'), 8 (datetime.time(0, 30), '00:30'), 9 (datetime.time(1, 0), '01:00'), 10 10 ...., 11 (datetime. Time(23, 30), '23:30')11 (datetime.time(23, 30), '23:30') 12 12 ] 13 13 }}}