c17971a2d8
* syntax: add datetime validator (and interop tests) * syntax: improve datetime normalization * lexicon: stronger datetime validation (from syntax package) * syntax: make datetime syntax norm test more flexible * make fmt * datetime: docs, normalize and always variant * bsky replace toSimplifiedISOSafe with normalizeDatetimeAlways * more rigorous datetime parsing on record creation * handle negative dates * syntax: disallow datetimes before year 0010 * syntax: datetime normalization functions validate output --------- Co-authored-by: dholms <dtholmgren@gmail.com>
69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
|
||
# subtle changes to: 1985-04-12T23:20:50.123Z
|
||
1985-04-12T23:20:50.123z
|
||
01985-04-12T23:20:50.123Z
|
||
985-04-12T23:20:50.123Z
|
||
1985-04-12T23:20:50.Z
|
||
1985-04-32T23;20:50.123Z
|
||
1985-04-32T23;20:50.123Z
|
||
|
||
# en-dash and em-dash
|
||
1985—04-32T23;20:50.123Z
|
||
1985–04-32T23;20:50.123Z
|
||
|
||
# whitespace
|
||
1985-04-12T23:20:50.123Z
|
||
1985-04-12T23:20:50.123Z
|
||
1985-04-12T 23:20:50.123Z
|
||
|
||
# not enough zero padding
|
||
1985-4-12T23:20:50.123Z
|
||
1985-04-2T23:20:50.123Z
|
||
1985-04-12T3:20:50.123Z
|
||
1985-04-12T23:0:50.123Z
|
||
1985-04-12T23:20:5.123Z
|
||
|
||
# too much zero padding
|
||
01985-04-12T23:20:50.123Z
|
||
1985-004-12T23:20:50.123Z
|
||
1985-04-012T23:20:50.123Z
|
||
1985-04-12T023:20:50.123Z
|
||
1985-04-12T23:020:50.123Z
|
||
1985-04-12T23:20:050.123Z
|
||
|
||
# strict capitalization (ISO-8601)
|
||
1985-04-12t23:20:50.123Z
|
||
1985-04-12T23:20:50.123z
|
||
|
||
# RFC-3339, but not ISO-8601
|
||
1985-04-12T23:20:50.123-00:00
|
||
1985-04-12_23:20:50.123Z
|
||
1985-04-12 23:20:50.123Z
|
||
|
||
# ISO-8601, but weird
|
||
1985-04-274T23:20:50.123Z
|
||
|
||
# timezone is required
|
||
1985-04-12T23:20:50.123
|
||
1985-04-12T23:20:50
|
||
|
||
1985-04-12
|
||
1985-04-12T23:20Z
|
||
1985-04-12T23:20:5Z
|
||
1985-04-12T23:20:50.123
|
||
+001985-04-12T23:20:50.123Z
|
||
23:20:50.123Z
|
||
|
||
1985-04-12T23:20:50.123+00
|
||
1985-04-12T23:20:50.123+00:0
|
||
1985-04-12T23:20:50.123+0:00
|
||
1985-04-12T23:20:50.123
|
||
1985-04-12T23:20:50.123+0000
|
||
1985-04-12T23:20:50.123+00
|
||
1985-04-12T23:20:50.123+
|
||
1985-04-12T23:20:50.123-
|
||
|
||
# ISO-8601, but normalizes to a negative time
|
||
0000-01-01T00:00:00+01:00
|
||
-000001-12-31T23:00:00.000Z
|