specs icon indicating copy to clipboard operation
specs copied to clipboard

Extend specification with non default format for types yearmonth and year

Open pajachiet opened this issue 6 years ago • 2 comments

It would be very useful for us to extend the specification toaccept non default formats for type yearmonth, in the same way as date, time and datetime.

If we extend the specification for type yearmonth, it would be logical to extend it also for type year.

Our usecase is to describe a large database with tableschema, where yearmonth is writen with format YYYYMM and not default YYYY-MM.

This would allow us to validate the data, and to generate fake data with our beta library tsfaker.

pajachiet avatar Feb 05 '20 17:02 pajachiet

@pajachiet this seems very sensible. A PR for the change would be welcomed.

rufuspollock avatar Feb 06 '20 18:02 rufuspollock

Consider a datetime type property modifier, similar to numeric, integer and boolean, to specify a different EDTF level, e.g. EDTF-0, EDTF-1, EDTF-2 with EDTF-0 as the default, which is ISO-8601-1 (see detail below).

EDTF https://www.loc.gov/standards/datetime/ defines a robust date-time encoding syntax with multiple, escalating complexity levels.

Three conformance levels are defined: level 0, level 1, and level 2. Level 0 specifies features of ISO 8601-1; Levels 1 and 2 specify features described ISO 8601-2.

rjgladish avatar Jan 27 '24 14:01 rjgladish