Checks if the given value is a valid Dayjs object.
Note that dayjs is not a constructor, so you can't simply use @IsInstance(dayjs).
dayjs
@IsInstance(dayjs)
// Ensure the value is a Dayjs object.@IsDayjs()dateOfBirth: Dayjs Copy
// Ensure the value is a Dayjs object.@IsDayjs()dateOfBirth: Dayjs
Optional
Accepts the following options (in addition to generic class-validator options):
allow_invalid: boolean = false
Checks if the given value is a valid Dayjs object.
Note that
dayjs
is not a constructor, so you can't simply use@IsInstance(dayjs)
.Example