@hueniverse
The Schema which am using :
const Joi = require('joi');
const Schema = {
birthday: Joi.date().min('01-01-1960').max('12-31-2003').required()
}
It works fine in google chrome but in mozilla Its throwing an error,
The error is:"Error: date must have a valid date format or reference"
So, I tried to use format() like this:
const Schema = {
birthday: Joi.date().format('MM/DD/YYYY').min('01-01-1960').max('12-31-2003').iso().required()
}
But now mozilla firefox is Throwing:
Error: date must have a valid date format or reference
And google chrome is throwing:
Error: Unknown date format MM/DD/YYYY
Am trying to validate date with min and max date . so can someone please get me a solution for this.
Thanks in Advance
Try:
const Joi = require('joi');
const Schema = {
birthday: Joi.date().min('01/01/1960').max('12/31/2003').required()
}
If that works I'll look at adjusting the strings internally.
@hueniverse
Thank you for that code... This code is working perfectly...
Most helpful comment
Try:
If that works I'll look at adjusting the strings internally.