Comment on page
Date validations
required
: can't be undefined (default:false
)equal
: * equal to passed valuemin
: ** must be after passed datemax
** must be before passed datenullable
: accepts null (default:false
)
const Product = attributes({
fabricationDate: {
type: Date,
default: () => Date.now()
},
expirationDate: {
type: Date,
min: { attr: 'fabricationDate' }
},
createdAt: {
type: Date,
nullable: true
}
})(class Product { });
Last modified 3yr ago