Skip to content

Function.date

github-actions[bot] edited this page Jul 8, 2026 · 30 revisions

umt / date

Function: date()

date(message?): (value) => ValidateCoreReturnType<Date> & StandardSchemaV1<Date, Date>

Defined in: Validate/date/core.ts:20

Creates a Date validator. The validator checks both that the value is an instance of Date and that it represents a valid moment in time (i.e. its underlying timestamp is not NaN), so values created from invalid inputs such as new Date("not-a-date") are rejected.

Parameters

message?

string

Custom error message for type validation

Returns

(value) => ValidateCoreReturnType<Date> & StandardSchemaV1<Date, Date>

  • Validator function that checks if the value is a Date instance

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally