Skip to content

Commit 02a704a

Browse files
authored
Define ISO 8601-1:2019 interval schemas (#21)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent f0d858d commit 02a704a

36 files changed

Lines changed: 6491 additions & 0 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Calendar Date, Basic Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by calendar date combined with complete local time of day in basic format [duration][\"/\"][YYYY][MM][DD][\"T\"][hh][mm][ss] (§5.5.3.3 a)",
5+
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/19850412T232050",
8+
"P1Y/20001231T235959",
9+
"PT5H30M/20230615T180000",
10+
"P2W/19850101T000000"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^(?:P[0-9]+(?:\\.[0-9]+)?W|P[0-9]+(?:\\.[0-9]+)?Y|P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?D|PT[0-9]+(?:\\.[0-9]+)?H|PT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?H|P[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-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?S)/([0-9]{4}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01])|[0-9]{4}(0[469]|11)(0[1-9]|[12][0-9]|30)|[0-9]{4}02(0[1-9]|1[0-9]|2[0-9]))T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Calendar Date, Extended Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by calendar date combined with complete local time of day in extended format [duration][\"/\"][YYYY][\"-\"][MM][\"-\"][DD][\"T\"][hh][\":\"[mm][\":\"[ss] (§5.5.3.3 b)",
5+
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/1985-04-12T23:20:50",
8+
"P1Y/2000-12-31T23:59:59",
9+
"PT5H30M/2023-06-15T18:00:00",
10+
"P2W/1985-01-01T00:00:00"
11+
],
12+
"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0-9]:([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Ordinal Date, Basic Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by ordinal date combined with complete local time of day in basic format [duration][\"/\"][YYYY][DDD][\"T\"][hh][mm][ss] (§5.5.3.4 a, §5.5.3.3 a)",
5+
"$comment": "The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/1985102T232050",
8+
"P1Y/2000366T235959",
9+
"PT5H30M/2023166T180000",
10+
"P2W/1985001T000000"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^(?:P[0-9]+(?:\\.[0-9]+)?W|P[0-9]+(?:\\.[0-9]+)?Y|P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?D|PT[0-9]+(?:\\.[0-9]+)?H|PT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+YT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+YT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+YT[0-9]+M[0-9]+(?:\\.[0-9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.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?S)/[0-9]{4}(00[1-9]|0[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-6])T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Ordinal Date, Extended Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by ordinal date combined with complete local time of day in extended format [duration][\"/\"][YYYY][\"-\"][DDD][\"T\"][hh][\":\"[mm][\":\"[ss] (§5.5.3.4 a, §5.5.3.3 b)",
5+
"$comment": "The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/1985-102T23:20:50",
8+
"P1Y/2000-366T23:59:59",
9+
"PT5H30M/2023-166T18:00:00",
10+
"P2W/1985-001T00:00:00"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^(?:P[0-9]+(?:\\.[0-9]+)?W|P[0-9]+(?:\\.[0-9]+)?Y|P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[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]+(?:\\.[0-9]+)?M|P[0-9]+MT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+MT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+MT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+MT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+M[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?S)/[0-9]{4}-(00[1-9]|0[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-6])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Week Date, Basic Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by week date combined with complete local time of day in basic format [duration][\"/\"][YYYY][\"W\"][ww][D][\"T\"][hh][mm][ss] (§5.5.3.4 a, §5.5.3.3 a)",
5+
"$comment": "The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/1985W155T232050",
8+
"P1Y/2000W527T235959",
9+
"PT5H30M/2023W241T180000",
10+
"P2W/1985W011T000000"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^(?:P[0-9]+(?:\\.[0-9]+)?W|P[0-9]+(?:\\.[0-9]+)?Y|P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?D|PT[0-9]+(?:\\.[0-9]+)?H|PT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+YT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+YT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+YT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+Y[0-9]+MT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+MT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+MT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+Y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9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Duration and End (Week Date, Extended Format)",
4+
"description": "A time interval identified by its duration and end, using a duration followed by week date combined with complete local time of day in extended format [duration][\"/\"][YYYY][\"-\"][\"W\"][ww][\"-\"][D][\"T\"][hh][\":\"[mm][\":\"[ss] (§5.5.3.4 a, §5.5.3.3 b)",
5+
"$comment": "The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"P1Y2M15DT12H30M0S/1985-W15-5T23:20:50",
8+
"P1Y/2000-W52-7T23:59:59",
9+
"PT5H30M/2023-W24-1T18:00:00",
10+
"P2W/1985-W01-1T00:00:00"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^(?:P[0-9]+(?:\\.[0-9]+)?W|P[0-9]+(?:\\.[0-9]+)?Y|P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M|P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+(?:\\.[0-9]+)?D|P[0-9]+(?:\\.[0-9]+)?D|PT[0-9]+(?:\\.[0-9]+)?H|PT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?M|PT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|PT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+YT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+YT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+YT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S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[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+M[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?H|P[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?M|P[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S|P[0-9]+DT[0-9]+(?:\\.[0-9]+)?S)/[0-9]{4}-W(0[1-9]|[1-4][0-9]|5[0-3])-[1-7]T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)$"
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Time Interval by Start and Duration (Calendar Date, Basic Format)",
4+
"description": "A time interval identified by its start and duration, using calendar date combined with complete local time of day in basic format followed by a duration [YYYY][MM][DD][\"T\"][hh][mm][ss][\"/\"][duration] (§5.5.3.2 a)",
5+
"$comment": "This schema validates day/month combinations (i.e rejects April 31) but does not validate leap years. February 29 is accepted for any year, and leap year validation must be performed by the consumer. The duration component accepts designator format (P...) and weeks format (PnW)",
6+
"examples": [
7+
"19850412T232050/P1Y2M15DT12H30M0S",
8+
"20000101T000000/P1Y",
9+
"20230615T120000/PT5H30M",
10+
"19851231T235959/P2W"
11+
],
12+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
13+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
14+
"type": "string",
15+
"pattern": "^([0-9]{4}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01])|[0-9]{4}(0[469]|11)(0[1-9]|[12][0-9]|30)|[0-9]{4}02(0[1-9]|1[0-9]|2[0-9]))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