Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for min/max-inclusive exclusive for dates #119

Open
labra opened this issue Jan 13, 2022 · 1 comment
Open

Add support for min/max-inclusive exclusive for dates #119

labra opened this issue Jan 13, 2022 · 1 comment

Comments

@labra
Copy link
Contributor

labra commented Jan 13, 2022

No description provided.

@ericprud
Copy link
Contributor

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

[13t] literal ::= rdfLiteral | numericLiteral | booleanLiteral | DATETIME | DATE | TIME

XSD Appendicx D 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 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).

@ericprud ericprud transferred this issue from shexSpec/spec Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants