Closed tjwelde closed 5 years ago
The time-zone
is optional for format: "time"
I'm going to update the return value to be like 20:20:39
After v7.21.0, add "step": 1
, to return value to be like 20:20:39
{
"type": "string",
"format": "time",
"step": 1
}
Ah cool. Thanks for looking into it and fixing it.
Why do we need "step": 1
? I don't see it in the json-schema draft-07?
step
is a non-standard field,
it's a UI related field,
it comes from <input type="time">
: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input/time
Ah, to add it to the input field.
I think the step
attribute should be 1 per default for time formats, because it is defined like that: https://tools.ietf.org/html/rfc3339#page-8 (search full-time
). It is the definition used by draft 07 of json-schema.
I wouldn't want to bloat my json-schema, so it works for this specific editor. A preparation step, to modify the schema to meet the needs of this editor is also not a nice solution.
Could you make step="1"
the default for time formats?
Withoutstep="1"
, the result is not verifiable against json-schema, so I would think it makes sense to have it as default
It should be OK for v7.22.0
Man, you are quick. Works like a charm. Thanks a lot!
Version(if relevant):
7.20.2
Environment(if relevant):
React
Code(if relevant):
schema:
Expected:
According to https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times I expect the returned value from the editor to be:
20:20:39+00:00
Actual:
20:20