Closed zynga-jpetersen closed 6 months ago
Looking at https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
full-time = partial-time time-offset
partial-time = time-hour ":" time-minute ":" time-second [time-secfrac]
time-offset = "Z" / time-numoffset
time ends with time-offset
which contains a Z
.
Let me know why you think 00:00:00 is a valid rfc3339 time,
According https://datatracker.ietf.org/doc/html/rfc3339#section-5.6, the time fraction shouldn't be required:
The current time regex can be found at https://github.com/microsoft/vscode-json-languageservice/blob/5692bed6db771d0f8985f89a9ecd9e3bc96cbc00/src/parser/jsonParser.ts#L23
Examples that it will accept is: "00:00:00+00:00" or "00:00:00Z"
But If I'm correct about 00:00:00 being a valid rfc3339 time, then my suggestion is that the regex should instead be:
/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?((Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9])))+$/i
Additional Documentation: Json Schema documentation about the time format