You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zod has the ability to parse time using z.string().time() for the format HH:mm:SS[.s+]
However, this time validation is not compatible with browser API that only holds HH:mm for
Is it possible to make the seconds part also optional in this parsing, so it gets easier to parse dates compatible with time input?
The text was updated successfully, but these errors were encountered:
z.string().regex(/\d{2}:\d{2}/,"Time format expected is HH:mm").refine((str)=>{const[hour,minute]=str.split(":").map((d)=>parseInt(d));return(hour!=undefined&&minute!=undefined&&hour>=0&&hour<24&&minute>=0&&minute<60);});
Zod has the ability to parse time using z.string().time() for the format HH:mm:SS[.s+]
However, this time validation is not compatible with browser API that only holds HH:mm for
Is it possible to make the seconds part also optional in this parsing, so it gets easier to parse dates compatible with time input?
The text was updated successfully, but these errors were encountered: