Aller au contenu principal

date()

date(message?): DateConstraint

Date schema with 0 overhead after tsup + Terser build.

Usage identical to before:

  • date()
  • date("Custom error")
  • date().min(new Date())
  • date().max(new Date())

Parameters

message?: string

Custom error message (optional).


Returns: DateConstraint

DateConstraint with all constraints.


Since

2.0.0