Date autocomplete helper strips leading zeroes from dates
|Google Code Legacy ID:||Tested version:|
- Create a new description
- In the dates field, enter a date with leading zeroes - e.g. 2001-01-01 - 2004-03-05
- Click out of the field so the helper can try to auto-fill the start and end date values
- Leading zeroes are stripped, though they are technically correct according to ISO 8601 formatting. Dates in start/end field appear as 2001-1-1 and 2004-3-5.
AtoM does not strip leading zeroes from date values passed by the helper to start/end date fields.
See note 5 on issue #10716 - currently, on save AtoM is checking and adding the zeroes back IN to make sure the date format is saved correctly. So in the view page, it will display correctly, and in the database the date format will be correct. If you re-enter edit mode, the leading zeroes are now present.
This is therefore a minor issue; essentially though the work done on #10716 now prevents an incorrect date format from being saved as-is, this current behavior sends conflicting messages to the end-user, first stripping out the zeroes while they are in edit mode, and then adding them back in on save.
We should change the helper JS so it is consistent with the desired end-result - e.g. so it no longer strips leading zeroes.