79596975

Date: 2025-04-28 17:13:25
Score: 0.5
Natty:
Report link

What does the PrimeVue DatePicker return? A date object or a formatted string? If PrimeVue parses it automatically, it's a Date, and your string regex validation gets skipped. This could be why your validations are having issues. Your form schema seems to expect a string. If they are expecting different types, this could be where the issue is happening.

If it does return a date object then could you simply do:

const formSchema = z.object({
  start_date: z
    .date()
    .refine((date) => date !== null, "Start date is required."),
});
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What do
  • Low reputation (0.5):
Posted by: David