Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/time/beginning-day-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Beginning of the Day (Basic Format)",
"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)",
"examples": [ "T000000", "000000" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?000000$"
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/time/beginning-day-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Beginning of the Day (Extended Format)",
"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)",
"examples": [ "00:00:00", "T00:00:00" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?00:00:00$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/decimal-hour-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Hour (Basic Format)",
"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)",
"$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",
"examples": [ "T23,3", "T23.3", "T00,0", "T12.5", "T15,75" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])[.,][0-9]+$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/decimal-minute-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Minute (Basic Format)",
"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)",
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
"examples": [ "T2320,8", "T2320.8", "T0000,0", "T2359,999", "T1200.5" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])[0-5][0-9][.,][0-9]+$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/decimal-minute-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Minute (Extended Format)",
"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)",
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
"examples": [ "23:20,8", "T23:20.8", "00:00,0", "T23:59,999", "12:00.5" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9][.,][0-9]+$"
}
17 changes: 17 additions & 0 deletions schemas/iso/datetime/2019/time/decimal-second-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Second (Basic Format)",
"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)",
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
"examples": [
"T232030,5",
"T232030.5",
"T000000,0",
"T235959,999",
"T120000.123456"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)[.,][0-9]+$"
}
17 changes: 17 additions & 0 deletions schemas/iso/datetime/2019/time/decimal-second-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Decimal Second (Extended Format)",
"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)",
"$comment": "The decimal fraction must have at least one digit. The standard allows both comma and period as decimal signs",
"examples": [
"23:20:30,5",
"T23:20:30.5",
"00:00:00,0",
"T23:59:59,999",
"12:00:00.123456"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)[.,][0-9]+$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/hour-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day - Hour Only (Basic Format)",
"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)",
"$comment": "Extended format is not applicable for hour-only representations as there are no separators to extend",
"examples": [ "T23", "T00", "T12", "T01", "T15" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])$"
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/time/hour-minute-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day - Hour and Minute (Basic Format)",
"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)",
"examples": [ "T2320", "T0000", "T2359", "T1200", "T0101" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])[0-5][0-9]$"
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/time/hour-minute-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day - Hour and Minute (Extended Format)",
"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)",
"examples": [ "23:20", "T23:20", "00:00", "T23:59", "12:00", "T01:01" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9]$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/local-day-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day (Basic Format)",
"description": "A complete representation of local time of day in basic format [\"T\"][hh][mm][ss] where the time designator \"T\" may be omitted by mutual agreement (§5.3.1.2 a)",
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap second validity in specific contexts) must be performed by the consumer",
"examples": [ "T232050", "T000000", "T235960", "T120000", "T010101" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)$"
}
18 changes: 18 additions & 0 deletions schemas/iso/datetime/2019/time/local-day-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day (Extended Format)",
"description": "A complete representation of local time of day in extended format [hh][:][mm][:][ss] or [\"T\"][hh][:][mm][:][ss] where the time designator \"T\" may be omitted by mutual agreement (§5.3.1.2 b)",
"$comment": "This schema provides syntactic validation only. Semantic validation (e.g., leap second validity in specific contexts) must be performed by the consumer",
"examples": [
"23:20:50",
"T23:20:50",
"00:00:00",
"T23:59:60",
"12:00:00",
"T01:01:01"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)$"
}
17 changes: 17 additions & 0 deletions schemas/iso/datetime/2019/time/local-day-shift-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Time Shift (Basic Format)",
"description": "A representation of local time of day with time shift from UTC in basic format [\"T\"][hh][mm][ss][±][hh][mm] or [\"T\"][hh][mm][ss][±][hh] or [\"T\"][hh][mm][ss]Z where the time designator \"T\" may be omitted by mutual agreement and the time shift may include hours only or be Z for UTC (§5.3.4.2 a)",
"examples": [
"T152746+0100",
"T152746-0530",
"T152746Z",
"152746+01",
"T000000+0000",
"235960-1200"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)(?:Z|[+-](?:[01][0-9]|2[0-3])(?:[0-5][0-9])?)$"
}
17 changes: 17 additions & 0 deletions schemas/iso/datetime/2019/time/local-day-shift-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Local Time of Day with Time Shift (Extended Format)",
"description": "A representation of local time of day with time shift from UTC in extended format [hh][:][mm][:][ss][±][hh][:][mm] or [\"T\"][hh][:][mm][:][ss][±][hh] or [hh][:][mm][:][ss]Z where the time designator \"T\" may be omitted by mutual agreement and the time shift may include hours only or be Z for UTC (§5.3.4.2 b)",
"examples": [
"15:27:46+01:00",
"T15:27:46-05:30",
"15:27:46Z",
"T15:27:46+01",
"00:00:00+00:00",
"T23:59:60-12:00"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(?:Z|[+-](?:[01][0-9]|2[0-3])(?::[0-5][0-9])?)$"
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/time/shift-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Time Shift from UTC (Basic Format)",
"description": "A representation of the time shift between local time scale and UTC in basic format [±][hh][mm] or [±][hh] or Z where Z is the UTC designator representing zero shift (§5.3.4.1)",
"examples": [ "+0100", "-0530", "+00", "-12", "Z", "+1400", "-0000" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^(?:Z|[+-](?:[01][0-9]|2[0-3])(?:[0-5][0-9])?)$"
}
11 changes: 11 additions & 0 deletions schemas/iso/datetime/2019/time/shift-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Time Shift from UTC (Extended Format)",
"description": "A representation of the time shift between local time scale and UTC in extended format [±][hh][:][mm] or Z where Z is the UTC designator representing zero shift (§5.3.4.1)",
"$comment": "Extended format is not applicable for hour-only time shifts",
"examples": [ "+01:00", "-05:30", "Z", "+14:00", "-00:00", "+12:45" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$"
}
19 changes: 19 additions & 0 deletions schemas/iso/datetime/2019/time/utc-day-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 UTC of Day (Basic Format)",
"description": "A representation of UTC of day in basic format [\"T\"][hh][mm][ss]Z or [\"T\"][hh][mm]Z or [\"T\"][hh]Z where the time designator \"T\" may be omitted by mutual agreement and Z is the UTC designator (§5.3.3 a)",
"examples": [
"T232030Z",
"T2320Z",
"T23Z",
"232030Z",
"000000Z",
"T120000Z",
"1200Z",
"12Z"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?(?:([01][0-9]|2[0-3])[0-5][0-9]([0-5][0-9]|60)|([01][0-9]|2[0-3])[0-5][0-9]|([01][0-9]|2[0-3]))Z$"
}
19 changes: 19 additions & 0 deletions schemas/iso/datetime/2019/time/utc-day-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 UTC of Day (Extended Format)",
"description": "A representation of UTC of day in extended format [hh][:][mm][:][ss]Z or [\"T\"][hh][:][mm][:][ss]Z or [hh][:][mm]Z or [\"T\"][hh][:][mm]Z where the time designator \"T\" may be omitted by mutual agreement and Z is the UTC designator (§5.3.3 b)",
"$comment": "Extended format is not applicable for hour-only representations",
"examples": [
"23:20:30Z",
"T23:20:30Z",
"23:20Z",
"T23:20Z",
"00:00:00Z",
"T12:00:00Z",
"12:00Z"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.iso.org/standard/70907.html" ],
"type": "string",
"pattern": "^T?(?:([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)|([01][0-9]|2[0-3]):[0-5][0-9])Z$"
}
76 changes: 76 additions & 0 deletions test/iso/datetime/2019/time/beginning-day-basic.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"target": "../../../../../schemas/iso/datetime/2019/time/beginning-day-basic.json",
"tests": [
{
"description": "Invalid type - integer",
"data": 0,
"valid": false
},
{
"description": "Invalid type - boolean",
"data": true,
"valid": false
},
{
"description": "Invalid type - null",
"data": null,
"valid": false
},
{
"description": "Valid - T000000",
"data": "T000000",
"valid": true
},
{
"description": "Valid - 000000 without T",
"data": "000000",
"valid": true
},
{
"description": "Invalid - lowercase t",
"data": "t000000",
"valid": false
},
{
"description": "Invalid - any non-zero hour",
"data": "T010000",
"valid": false
},
{
"description": "Invalid - any non-zero minute",
"data": "T000100",
"valid": false
},
{
"description": "Invalid - any non-zero second",
"data": "T000001",
"valid": false
},
{
"description": "Invalid - colons (extended format)",
"data": "T00:00:00",
"valid": false
},
{
"description": "Invalid - 000000 with colons",
"data": "00:00:00",
"valid": false
},
{
"description": "Invalid - too few digits",
"data": "T00000",
"valid": false
},
{
"description": "Invalid - too many digits",
"data": "T0000000",
"valid": false
},
{
"description": "Invalid - empty string",
"data": "",
"valid": false
}
]
}
Loading