summaryrefslogtreecommitdiff
path: root/tests/draft2019-09/optional/format/date-time.json
blob: 119179caa7cca0c6f06e68ff107964c20548d523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[
    {
        "description": "validation of date-time strings",
        "schema": { "format": "date-time" },
        "tests": [
            {
                "description": "all string formats ignore integers",
                "data": 12,
                "valid": true
            },
            {
                "description": "all string formats ignore floats",
                "data": 13.7,
                "valid": true
            },
            {
                "description": "all string formats ignore objects",
                "data": {},
                "valid": true
            },
            {
                "description": "all string formats ignore arrays",
                "data": [],
                "valid": true
            },
            {
                "description": "all string formats ignore booleans",
                "data": false,
                "valid": true
            },
            {
                "description": "all string formats ignore nulls",
                "data": null,
                "valid": true
            },
            {
                "description": "a valid date-time string",
                "data": "1963-06-19T08:30:06.283185Z",
                "valid": true
            },
            {
                "description": "a valid date-time string without second fraction",
                "data": "1963-06-19T08:30:06Z",
                "valid": true
            },
            {
                "description": "a valid date-time string with plus offset",
                "data": "1937-01-01T12:00:27.87+00:20",
                "valid": true
            },
            {
                "description": "a valid date-time string with minus offset",
                "data": "1990-12-31T15:59:50.123-08:00",
                "valid": true
            },
            {
                "description": "a invalid day in date-time string",
                "data": "1990-02-31T15:59:60.123-08:00",
                "valid": false
            },
            {
                "description": "an invalid offset in date-time string",
                "data": "1990-12-31T15:59:60-24:00",
                "valid": false
            },
            {
                "description": "an invalid closing Z after time-zone offset",
                "data": "1963-06-19T08:30:06.28123+01:00Z",
                "valid": false
            },
            {
                "description": "an invalid date-time string",
                "data": "06/19/1963 08:30:06 PST",
                "valid": false
            },
            {
                "description": "case-insensitive T and Z",
                "data": "1963-06-19t08:30:06.283185z",
                "valid": true
            },
            {
                "description": "only RFC3339 not all of ISO 8601 are valid",
                "data": "2013-350T01:01:01",
                "valid": false
            },
            {
                "description": "invalid non-padded month dates",
                "data": "1963-6-19T08:30:06.283185Z",
                "valid": false
            },
            {
                "description": "invalid non-padded day dates",
                "data": "1963-06-1T08:30:06.283185Z",
                "valid": false
            },
            {
                "description": "non-ascii digits should be rejected in the date portion",
                "data": "1963-06-1৪T00:00:00Z",
                "valid": false
            },
            {
                "description": "non-ascii digits should be rejected in the time portion",
                "data": "1963-06-11T0৪:00:00Z",
                "valid": false
            }
        ]
    }
]