Protected
isProtected
preprocessorsA list of preprocessors associated with the Builder
Protected
typeProtected
validatorsA list of validators associated with the Builder
Accepts epoch number as a valid Date.
Epoch number will be parsed using new Date(epoch)
.
Accepts JSON string as a valid Date.
String must be in ISO format and will be parsed using JSON.parse()
.
Adds a preprocessor
to a preprocessors list
Adds a validator
to validators list.
Clears equals()
call.
Cancel isInFuture()
call.
Cancel isInPast()
call.
Clear max()
call.
Clear min()
call.
Remove all preprocessors for this schema.
Remove all validators for this schema.
Cancel acceptEpoch()
call.
Cancel acceptJsonString()
call.
Restricts Date to be equal to value
.
Generates a serializable object describing the defined schema
Make sure that date is in future. false
by default.
Make sure that date is in past. false
by default.
If set, restrict date to be equal to a certain value.
If set to false
, schema will be optional (null
or undefined
values
will be considered as valid).
Max valid value (if defined).
Min valid value (if defined).
If set, schema will try to parse date from the UNIX epoch (number).
false
by default.
If set, schema will try to parse date from JSON string.
false
by default.
Array of preprocessor functions
String id
of schema type, e.g. string',
numberor
object`.
Array of validator functions
Accept only dates in the future.
Accept only dates in the past.
Set maximal valid Date value for schema.
Set minimal valid Date value for schema.
Protected
prePerforms validion of Date schema over object
.
Optional
context: ValidationContextOptional ValidationContext
settings.
Static
createGenerated using TypeDoc
Allows to create Date schema. It can be required or optional. It can be restricted to be: equal to a certain value, in future, in past, in a certain range. Supports parsing from JSON string and UNIX epoch (using preprocessors).
NOTE this class is exported only to give opportunity to extend it by inheriting. It is not recommended to create an instance of this class directly. Use () function instead.
Example
Example
Example
Example
See
date