Changes between Initial Version and Version 2 of Ticket #28090
- Timestamp:
- Apr 20, 2017, 7:15:31 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28090
- Property Cc added
- Property Component Uncategorized → Forms
- Property Resolution → duplicate
- Property Triage Stage Unreviewed → Accepted
- Property Status new → closed
- Property Summary TimeField rendering in admin forms → TimeField's value incorrectly localized in forms
-
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 }}}