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.
- DateTimeInput and TimeInput exist, DateInput doesn't.
- DateTimeInput accepts format, but TimeInput doesn't.
- SplitDateTimeField doesn't use SplitDateTimeWidget by default.
- SplitDateTimeField doesn't allow the user to specify input_formats.
- SplitDateTimeWidget uses two TextInput widgets, instead of TimeInput and the missing DateInput (and thus doesn't allow the user to specify formats).
- django.contrib.localflavor.generic.forms is missing SplitDateTimeField.
- The documentation is sparse on detail for SplitDateTimeField, DateTimeInput and TimeInput.
This patch:
- Adds DateInput, which accepts format, and is used for DateField by default.
- Adds format as an argument to TimeInput.
- Uses SplitDateTimeWidget for SplitDateTimeField by default.
- Adds input_date_formats and input_time_formats as arguments to SplitDateTimeField.
- Uses DateInput and TimeInput for SplitDateTimeWidget, and passes through date_format and time_format through to DateInput and TimeInput as format, respectively.
- Adds SplitDateTimeField to django.contrib.localflavor.generic.forms.
- Adds documentation for all of these changes.
- Adds tests for all of these changes.