tickets: 8962
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8962 | 2008-09-08 08:40:25 | 2012-01-09 09:29:07 | 2022-03-06 03:43:37.994120 | Accepted | closed | Forms | Uncategorized | Normal | dev | fixed | Make `input_formats` and `format` work consistently across `date`, `datetime`, and `time` fields and widgets. | Currently, there are some inconsistencies in what form fields and widgets we have available for `date`, `datetime`, and `time` data. There are also inconsistencies in how the `format` argument applies to the widgets, and the `input_formats` applies to the fields. 1. `DateTimeInput` and `TimeInput` exist, `DateInput` doesn't. 2. `DateTimeInput` accepts `format`, but `TimeInput` doesn't. 3. `SplitDateTimeField` doesn't use `SplitDateTimeWidget` by default. 4. `SplitDateTimeField` doesn't allow the user to specify `input_formats`. 5. `SplitDateTimeWidget` uses two `TextInput` widgets, instead of `TimeInput` and the missing `DateInput` (and thus doesn't allow the user to specify `formats`). 6. `django.contrib.localflavor.generic.forms` is missing `SplitDateTimeField`. 7. The documentation is sparse on detail for `SplitDateTimeField`, `DateTimeInput` and `TimeInput`. This patch: 1. Adds `DateInput`, which accepts `format`, and is used for `DateField` by default. 2. Adds `format` as an argument to `TimeInput`. 3. Uses `SplitDateTimeWidget` for `SplitDateTimeField` by default. 4. Adds `input_date_formats` and `input_time_formats` as arguments to `SplitDateTimeField`. 5. Uses `DateInput` and `TimeInput` for `SplitDateTimeWidget`, and passes through `date_format` and `time_format` through to `DateInput` and `TimeInput` as `format`, respectively. 6. Adds `SplitDateTimeField` to `django.contrib.localflavor.generic.forms`. 7. Adds documentation for all of these changes. 8. Adds tests for all of these changes. | kmtracey | mrmachine | datetime format widget i18n-rf | 0 | 1 | 0 | 0 | 0 | 0 |