Add days to date ranges and simplify validation text to accommodate new format
Change to behaviour
From comment in #1216 (closed) here. For print publication and electronic publication date ranges (for chapter-processed books, Word one doc books, and for collections where the user inputs the metadata in the BCMS UI) we need to add a field for the start and end days of those ranges. The ranges should allow the user to input MM/DD/YYYY-MM/DD/YYYY and allow saving as per column C of the Validation Error Message for dates sheet.
Current behaviour
We currently only accommodate months and years for date ranges (you can see all the currently supported allowed and not allowed formats for these ranges from row 14–31 in the Validation Error Message for dates sheet, column C indicates if the format is allowed to save or not).
Steps to reproduce
- Go to chapter processed book metadata, or Word one doc, or collection
- Open the metadata modal
- See that you can add date ranges for Print Publication Range/Electronic Publication range, but they don't have a space for 'DD' only 'MM/YYYY'. The ranges should allow the user to input MM/DD/YYYY-MM/DD/YYYY.
Possible solution
As per the Validation Error Message for dates sheet, we are currently providing unique validation text for every single combination of date values a user could supply which currently is 16 different cases. Adding validation per input case once days in ranges are introduced would add another 38 unique validations (spreadsheet rows 32-79). Unique validation text for date ranges was proposed and developed at a time where only years were supported in date ranges (signed off in #423 (closed)). Since then we added months to date ranges (in #947 (closed)) and now adding days will add further complexity to the custom validation text, for which effort could be better spent elsewhere. With the knowledge now that days need to be supported in date ranges, the development for unique validation text doesn't make sense. A proposed solution is to add start and end day fields in metadata date ranges, allow the user to save in the cases marked as 'Yes' in column C of the Validation Error Message for dates sheet, and for all other cases where the date format provided is not correct and can't be saved, show the following validation help text:
Valid date of publication range is required. Supported date formats are: Year–; Month/Year–; Month/Day/Year–; Year–Year; Month/Year–Month/Year; Month/Day/Year-Month/Day/Year.
NCBI's priority feedback
I am going to put as migration as we have this in content to migrate - need to check with @jordandc when she is back on the volume and processing type; it may be something we can hold if it is not chapter-processed
QA Steps
[To be completed by Coko once dev is done]