Re: [spec] Add support for min/max-inclusive exclusive for dates (#44)

It would be nice to include a surface syntax for dates/times as as well.

> [13t] [literal](http://shex.io/shex-semantics/index.html#prod-literal) ::= rdfLiteral | numericLiteral | booleanLiteral | DATETIME | DATE | TIME

XSD [Appendicx D](https://www.w3.org/TR/xmlschema-2/#isoformats) covers the rules:

[[
C -- represents a digit used in the thousands and hundreds components, the "century" component, of the time element "year". Legal values are from 0 to 9.
Y -- represents a digit used in the tens and units components of the time element "year". Legal values are from 0 to 9.
M -- represents a digit used in the time element "month". The two digits in a MM format can have values from 1 to 12.
D -- represents a digit used in the time element "day". The two digits in a DD format can have values from 1 to 28 if the month value equals 2, 1 to 29 if the month value equals 2 and the year is a leap year, 1 to 30 if the month value equals 4, 6, 9 or 11, and 1 to 31 if the month value equals 1, 3, 5, 7, 8, 10 or 12.
h -- represents a digit used in the time element "hour". The two digits in a hh format can have values from 0 to 24. If the value of the hour element is 24 then the values of the minutes element and the seconds element must be 00 and 00.
m -- represents a digit used in the time element "minute". The two digits in a mm format can have values from 0 to 59.
s -- represents a digit used in the time element "second". The two digits in a ss format can have values from 0 to 60. In the formats described in this specification the whole number of seconds ·may· be followed by decimal seconds to an arbitrary level of precision. This is represented in the picture by "ss.sss". A value of 60 or more is allowed only in the case of leap seconds.
]]

but I haven't found the pattern for dateTime. I found a related [SO](https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime) with no apparent authoritative refs.

I think I punted on this in my own code before and used `[+-]?\d{4}-[01]\d-[0-3]\dT[0-5]\d:[0-5]\d:[0-5]\d(\.\d+)?([+-][0-2]\d:[0-5]\d|Z)?` (see [shex.js validator](https://github.com/shexjs/shex.js/blob/14131743c88eb9cc8748f30af2b267fd22d96624/packages/shex-validator/shex-validator.js#L770)).


-- 
GitHub Notification of comment by ericprud
Please view or discuss this issue at https://github.com/shexSpec/spec/issues/44#issuecomment-1013627571 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 15 January 2022 06:56:19 UTC