Open dwalt opened 1 year ago
Per discussion with Stakeholders, UTC offsets must also be considered. It is proposed to drop UTC offsets if precision of data in DateTime does not include a time entry. The mdJSON to CSDGM translation may be an example of how DateTime is currently reformatted to date only form in CSDGM.
It appears this requirement would be applicable to all writers. Development of a function to handle date time reformats may benefit in providing consistent, single application of logic.
See also related mdEditor issue adiwg/mdeditor#483
ISO will accept either a DateTime for Date tag. The rules are as follows:
If there is a time component, then write the date time in zero filled DateTime with UTC offset:
If there is no time component, then truncate time including UTC offset and recast to Date. If date is year/month or year only then truncate accordingly. Technically you can truncate to century as well:
Follow rules above for ISO, HTML and sbJSON formats as defined above
For CSDGM translation already exists
CSDGM writer is outputting date content from mdJSON to include the utc offset as a time element. CSDGM does not support utc and therefore time should not appear in this use case.
Date and DateTime formatted date fields are used throughout mdJSON. However, DateTime is zero filled, often implying a precision that doesn't exist. For instance, Citation dates are DateTime but many users use it to define a year of publication. The DateTime format in this case reduces readability and implies a non-existent precision. The proposal is for mdTranslator writers to interpret the data and reformat the DateTime accordingly to reflect the precision of the data as input. By reformatting it in mdTranslator avoids conditional formatting in mdEditor and additional user input.