Formify Docs

Date

Validate date strings — ISO format or any parseable date

Date

The date rule validates that a value is a valid date string — either ISO format (YYYY-MM-DD) or any string Date can parse.

Configuration

Config flagTypeDescription
datebooleanRequires a valid date string.
validationSchema: {
  birthday: { date: true },
}

With a custom message:

birthday: { date: "Enter a valid date" }

V builder

import { V } from "formify-js";

V.date()
V.date("Enter a valid date")

Default message

Must be a valid date

Examples

ValueResult
2024-01-15✅ Valid
01/15/2024✅ Valid
hello❌ Invalid
2024-13-40❌ Invalid (month/day out of range)

Things to know

  • The check is calendar-aware: 2024-02-30 fails because February never has 30 days.
  • If you need a specific fixed format, enforce it with the pattern validator instead.
  • Empty values pass unless required: true is also set.

On this page