Skip to content

Commit f0d858d

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

File tree

78 files changed

+10273
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+10273
-19
lines changed

schemas/iso/datetime/2019/date/calendar-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Calendar Date (Basic Format)",
44
"description": "A complete representation of a calendar date in basic format [YYYY][MM][DD] (§5.2.2.1 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap years for February 29) must be performed by the consumer",
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",
66
"examples": [ "19850412", "20000101", "20231231", "00000101", "99991231" ],
77
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
88
"x-links": [ "https://www.iso.org/standard/70907.html" ],

schemas/iso/datetime/2019/date/calendar-expanded-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Calendar Date Expanded (Basic Format)",
44
"description": "An expanded representation of a calendar date in basic format [±][YYYYYY][MM][DD] with six digits for the year (§5.2.2.3 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap years for February 29) must be performed by the consumer",
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",
66
"examples": [
77
"+0019850412",
88
"-0000010101",

schemas/iso/datetime/2019/date/calendar-expanded-extended.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Calendar Date Expanded (Extended Format)",
44
"description": "An expanded representation of a calendar date in extended format [±][YYYYYY][\"-\"][MM][\"-\"][DD] with six digits for the year (§5.2.2.3 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap years for February 29) must be performed by the consumer",
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",
66
"examples": [
77
"+001985-04-12",
88
"-000001-01-01",

schemas/iso/datetime/2019/date/calendar-extended.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Calendar Date (Extended Format)",
44
"description": "A complete representation of a calendar date in extended format [YYYY][\"-\"][MM][\"-\"][DD] (§5.2.2.1 b)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap years for February 29) must be performed by the consumer",
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",
66
"examples": [
77
"1985-04-12",
88
"2000-01-01",

schemas/iso/datetime/2019/date/week-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Week Date (Basic Format)",
44
"description": "A complete representation of a week date in basic format [YYYY][\"W\"][WW][D] where WW is the calendar week of year (01-53) and D is the calendar day of week (1-7) (§5.2.4.1 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., whether a year has 53 weeks) must be performed by the consumer",
5+
"$comment": "This schema provides syntactic validation only. Semantic validation (i.e whether a year has 53 weeks) must be performed by the consumer",
66
"examples": [ "1985W155", "2000W011", "2023W527", "0000W011", "9999W537" ],
77
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
88
"x-links": [ "https://www.iso.org/standard/70907.html" ],

schemas/iso/datetime/2019/date/week-expanded-basic.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Week Date Expanded (Basic Format)",
44
"description": "An expanded representation of a week date in basic format [±][YYYYYY][\"W\"][WW][D] with six digits for the year, WW as calendar week of year (01-53), and D as calendar day of week (1-7) (§5.2.4.3 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., whether a year has 53 weeks) must be performed by the consumer",
5+
"$comment": "This schema provides syntactic validation only. Semantic validation (i.e whether a year has 53 weeks) must be performed by the consumer",
66
"examples": [
77
"+001985W155",
88
"-000001W011",

schemas/iso/datetime/2019/date/week-expanded-extended.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Week Date Expanded (Extended Format)",
44
"description": "An expanded representation of a week date in extended format [±][YYYYYY][\"-\"][\"W\"][WW][\"-\"][D] with six digits for the year, WW as calendar week of year (01-53), and D as calendar day of week (1-7) (§5.2.4.3 a)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., whether a year has 53 weeks) must be performed by the consumer",
5+
"$comment": "This schema provides syntactic validation only. Semantic validation (i.e whether a year has 53 weeks) must be performed by the consumer",
66
"examples": [
77
"+001985-W15-5",
88
"-000001-W01-1",

schemas/iso/datetime/2019/date/week-extended.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "ISO 8601-1:2019 Week Date (Extended Format)",
44
"description": "A complete representation of a week date in extended format [YYYY][\"-\"][\"W\"][WW][\"-\"][D] where WW is the calendar week of year (01-53) and D is the calendar day of week (1-7) (§5.2.4.1 b)",
5-
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., whether a year has 53 weeks) must be performed by the consumer",
5+
"$comment": "This schema provides syntactic validation only. Semantic validation (i.e whether a year has 53 weeks) must be performed by the consumer",
66
"examples": [
77
"1985-W15-5",
88
"2000-W01-1",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day (Basic Format)",
4+
"description": "A representation of calendar date combined with complete local time of day in basic format [YYYY][MM][DD][\"T\"][hh][mm][ss] where the time designator \"T\" separates date from time (§5.4.2.1 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",
6+
"examples": [
7+
"19850412T232050",
8+
"20000101T000000",
9+
"20231215T235959",
10+
"19000301T120000",
11+
"21001231T180000"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
15+
"type": "string",
16+
"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]))T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)$"
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Date and Local Time of Day (Extended Format)",
4+
"description": "A representation of calendar date combined with complete local time of day in extended format [YYYY][\"-\"][MM][\"-\"][DD][\"T\"][hh][\":\"[mm][\":\"[ss] where the time designator \"T\" separates date from time (§5.4.2.1 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",
6+
"examples": [
7+
"1985-04-12T23:20:50",
8+
"2000-01-01T00:00:00",
9+
"2023-12-15T23:59:59",
10+
"1900-03-01T12:00:00",
11+
"2100-12-31T18:00:00"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
15+
"type": "string",
16+
"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]))T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)$"
17+
}

0 commit comments

Comments
 (0)