DateTimeField does not support all DEFAULT_DATETIME_INPUT_FORMATS when passed a list as input
|Reported by:||uggedal||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When using for instance a SplitDateTimeWidget with a DateTimeField one can not provide valid input to be parsed with the following formats:
'%Y-%m-%d', # '2006-10-25' '%m/%d/%Y', # '10/25/2006' '%m/%d/%y', # '10/25/06'
One can therefore not create a split input solution where the time component is not required. The reason lies in SplitDateTimeWidget's clean method for list input. The date and time parts are concatenated together with a space between them. I included a patch for the simplest thing that would work (albeit possible not the best way to handle this).
SplitDateTimeField exists, but this field explicitly requires both date and time fields to be included.
Change History (11)
Changed 6 years ago by uggedal
comment:1 Changed 6 years ago by uggedal
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 6 years ago by jacob
- Triage Stage changed from Unreviewed to Design decision needed