Skip to content

Commit bb099f5

Browse files
committed
Define ISO 8601-1:2019 date strings
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent 5ebad30 commit bb099f5

File tree

54 files changed

+3312
-2
lines changed

Some content is hidden

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

54 files changed

+3312
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Date (Basic Format)",
4+
"description": "A complete representation of a calendar date in basic format [YYYY][MM][DD] (§5.2.2.1 a)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "19850412", "20000101", "20231231", "00000101", "99991231" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"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]))$"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Century",
4+
"description": "A calendar date with reduced precision representing a specific century [YY] (§5.2.2.2 d)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "19", "20", "00", "99" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"pattern": "^[0-9]{2}$"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Decade",
4+
"description": "A calendar date with reduced precision representing a specific decade [YYY] (§5.2.2.2 c)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "198", "200", "202", "000", "999" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"pattern": "^[0-9]{3}$"
10+
}
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 Calendar Date Expanded (Basic Format)",
4+
"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": "https://www.iso.org/standard/70907.html",
6+
"examples": [
7+
"+0019850412",
8+
"-0000010101",
9+
"+9999991231",
10+
"+0000000101",
11+
"-0100000101"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"pattern": "^([+-][0-9]{6}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01])|[+-][0-9]{6}(0[469]|11)(0[1-9]|[12][0-9]|30)|[+-][0-9]{6}02(0[1-9]|1[0-9]|2[0-9]))$"
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Century Expanded",
4+
"description": "An expanded representation of a calendar century [±][YYYY] with four digits (§5.2.2.3 e)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "+0019", "-0000", "+9999", "+0000", "-0100" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"pattern": "^[+-][0-9]{4}$"
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Decade Expanded",
4+
"description": "An expanded representation of a calendar decade [±][YYYYY] with five digits (§5.2.2.3 d)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "+00198", "-00000", "+99999", "+00000", "-01000" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"pattern": "^[+-][0-9]{5}$"
10+
}
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 Calendar Date Expanded (Extended Format)",
4+
"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": "https://www.iso.org/standard/70907.html",
6+
"examples": [
7+
"+001985-04-12",
8+
"-000001-01-01",
9+
"+999999-12-31",
10+
"+000000-01-01",
11+
"-010000-01-01"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"pattern": "^([+-][0-9]{6}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|[+-][0-9]{6}-(0[469]|11)-(0[1-9]|[12][0-9]|30)|[+-][0-9]{6}-02-(0[1-9]|1[0-9]|2[0-9]))$"
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 Calendar Month Expanded (Extended Format)",
4+
"description": "An expanded representation of a calendar month in extended format [±][YYYYYY][\"-\"][MM] with six digits for the year (§5.2.2.3 b)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [
7+
"+001985-04",
8+
"-000001-01",
9+
"+999999-12",
10+
"+000000-01",
11+
"-010000-12"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"pattern": "^[+-][0-9]{6}-(0[1-9]|1[0-2])$"
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Calendar Year Expanded",
4+
"description": "An expanded representation of a calendar year [±][YYYYYY] with six digits for the year (§5.2.2.3 c)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [ "+001985", "-000001", "+999999", "+000000", "-010000" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"type": "string",
9+
"pattern": "^[+-][0-9]{6}$"
10+
}
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 Calendar Date (Extended Format)",
4+
"description": "A complete representation of a calendar date in extended format [YYYY][\"-\"][MM][\"-\"][DD] (§5.2.2.1 b)",
5+
"$comment": "https://www.iso.org/standard/70907.html",
6+
"examples": [
7+
"1985-04-12",
8+
"2000-01-01",
9+
"2023-12-31",
10+
"0000-01-01",
11+
"9999-12-31"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
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]))$"
16+
}

0 commit comments

Comments
 (0)