Skip to content

Commit dbd2fec

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

36 files changed

+2853
-0
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 Beginning of the Day (Basic Format)",
4+
"description": "A representation of the beginning of a calendar day in basic format [\"T\"]000000 where the time designator \"T\" may be omitted by mutual agreement (§5.3.2)",
5+
"examples": [ "T000000", "000000" ],
6+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
7+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
8+
"type": "string",
9+
"pattern": "^T?000000$"
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 Beginning of the Day (Extended Format)",
4+
"description": "A representation of the beginning of a calendar day in extended format 00:00:00 or [\"T\"]00:00:00 where the time designator \"T\" may be omitted by mutual agreement (§5.3.2)",
5+
"examples": [ "00:00:00", "T00:00:00" ],
6+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
7+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
8+
"type": "string",
9+
"pattern": "^T?00:00:00$"
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Hour (Basic Format)",
4+
"description": "A representation of local time of day with decimal fraction of hour in basic format [\"T\"][hh][,][n] or [\"T\"][hh][.][n] where the time designator \"T\" may be omitted by mutual agreement and the decimal sign may be a comma or period (§5.3.1.4 e)",
5+
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs. Extended format is not applicable for hour-only representations",
6+
"examples": [ "T23,3", "T23.3", "T00,0", "T12.5", "T15,75" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
9+
"type": "string",
10+
"pattern": "^T([01][0-9]|2[0-3])[.,][0-9]+$"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Minute (Basic Format)",
4+
"description": "A representation of local time of day with decimal fraction of minute in basic format [\"T\"][hh][mm][,][n] or [\"T\"][hh][mm][.][n] where the time designator \"T\" may be omitted by mutual agreement and the decimal sign may be a comma or period (§5.3.1.4 c)",
5+
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
6+
"examples": [ "T2320,8", "T2320.8", "T0000,0", "T2359,999", "T1200.5" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
9+
"type": "string",
10+
"pattern": "^T([01][0-9]|2[0-3])[0-5][0-9][.,][0-9]+$"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Minute (Extended Format)",
4+
"description": "A representation of local time of day with decimal fraction of minute in extended format [hh][:][mm][,][n] or [\"T\"][hh][:][mm][.][n] where the time designator \"T\" may be omitted by mutual agreement and the decimal sign may be a comma or period (§5.3.1.4 d)",
5+
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
6+
"examples": [ "23:20,8", "T23:20.8", "00:00,0", "T23:59,999", "12:00.5" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
9+
"type": "string",
10+
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9][.,][0-9]+$"
11+
}
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 Local Time of Day with Decimal Second (Basic Format)",
4+
"description": "A representation of local time of day with decimal fraction of second in basic format [\"T\"][hh][mm][ss][,][n] or [\"T\"][hh][mm][ss][.][n] where the time designator \"T\" may be omitted by mutual agreement and the decimal sign may be a comma or period (§5.3.1.4 a)",
5+
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
6+
"examples": [
7+
"T232030,5",
8+
"T232030.5",
9+
"T000000,0",
10+
"T235959,999",
11+
"T120000.123456"
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": "^T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)[.,][0-9]+$"
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 Local Time of Day with Decimal Second (Extended Format)",
4+
"description": "A representation of local time of day with decimal fraction of second in extended format [hh][:][mm][:][ss][,][n] or [\"T\"][hh][:][mm][:][ss][.][n] where the time designator \"T\" may be omitted by mutual agreement and the decimal sign may be a comma or period (§5.3.1.4 b)",
5+
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
6+
"examples": [
7+
"23:20:30,5",
8+
"T23:20:30.5",
9+
"00:00:00,0",
10+
"T23:59:59,999",
11+
"12:00:00.123456"
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": "^T?([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)[.,][0-9]+$"
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "ISO 8601-1:2019 Local Time of Day - Hour Only (Basic Format)",
4+
"description": "A representation of local time of day with reduced precision to hour only in basic format [\"T\"][hh] where the time designator \"T\" may be omitted by mutual agreement (§5.3.1.3 c)",
5+
"$comment": "Extended format is not applicable for hour-only representations as there are no separators to extend",
6+
"examples": [ "T23", "T00", "T12", "T01", "T15" ],
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
9+
"type": "string",
10+
"pattern": "^T([01][0-9]|2[0-3])$"
11+
}
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 Local Time of Day - Hour and Minute (Basic Format)",
4+
"description": "A representation of local time of day with reduced precision to hour and minute in basic format [\"T\"][hh][mm] where the time designator \"T\" may be omitted by mutual agreement (§5.3.1.3 a)",
5+
"examples": [ "T2320", "T0000", "T2359", "T1200", "T0101" ],
6+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
7+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
8+
"type": "string",
9+
"pattern": "^T([01][0-9]|2[0-3])[0-5][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 Local Time of Day - Hour and Minute (Extended Format)",
4+
"description": "A representation of local time of day with reduced precision to hour and minute in extended format [hh][:][mm] or [\"T\"][hh][:][mm] where the time designator \"T\" may be omitted by mutual agreement (§5.3.1.3 b)",
5+
"examples": [ "23:20", "T23:20", "00:00", "T23:59", "12:00", "T01:01" ],
6+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
7+
"x-links": [ "https://www.iso.org/standard/70907.html" ],
8+
"type": "string",
9+
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9]$"
10+
}

0 commit comments

Comments
 (0)