Open u2ix opened 4 months ago
I have the same issue.
Likewise. I'm using js-joda to handle dates, and its LocalDateTime.toString()
implementation follows the spec.
I've noticed the same issue with z.string().time()
where it requires HH:MM:SS
to actually validate. The <input type='time' />
input by default uses HH:MM
as mentioned in the MDN docs
Hopefully this can be fixed sometime soon
Have an issue with a valid datetime value, as produced by the browser in a datetime picker field, is not accepted by the
datetime()
validation. After some digging I figured that when the seconds:00
are added the validation passes.But according to ISO 8601, just the hour is required for a valid time. Also as the timestamp is produced like this
"2024-07-18T11:00"
, I feel it would be really great if this is accepted by the library as also the Date constructor doesn't have any issue with this.For now I had to put in a quite ugly
preprocess
to make the validation pass on the value provided by the browser: