Date and Length Validators2:33 with Guil Hernandez
isDate validator to check for valid date strings for the birthday field, and use the
len (or length) validator to allow a password value only if it falls within a specific length (or an expected range) of characters.
DATEONLY data type follows the ISO international date format. It formats the date as:
You could set the value to '12-02-2000', for example, or even 'December 2, 2000', and Sequelize would still format it to ISO 8601 for the database. This ensures that all dates are stored in a consistent format.
- Per-attribute validations
- A thread regarding the Moment.js deprecation warning you may notice in the console when entering dates that are not in ISO format
- Use international date format (ISO)
You need to sign up for Treehouse in order to download course files.Sign up