digital-preservation / csv-schema

CSV Schema
http://digital-preservation.github.io/csv-schema
Mozilla Public License 2.0
100 stars 33 forks source link

Ability to use current date or year in appropriate tests #18

Open DavidUnderdown opened 7 years ago

DavidUnderdown commented 7 years ago

With date ranges or even simple numeric ranges if the field actually relates to a year it would sometimes be useful for the schema to be able to set the upper or lower bound of a range to the current date less a delta, or the end of the current year eg checking that we don't have any records that should be closed as the record subject's date of birth is less than 100 years ago. eg running validation now we might check: birth_date_year: range (1850,1916) as then there would be no issues with opening any records, but if we get more records in the same series next year we'd have to manually update the schema to increase the year by one, if we could do eg: birth_date_year: range(1850,currentYear-101) the schema would always work in the desired way