-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ensure date does not occur in the past #407
Comments
This is currently not supported but there are a few issues open related to this |
Would you accept a pull request for this? |
Absolutely. |
Sorry but no functions as inputs. I'll accept a PR that handles the string |
I just wrap the schema in a function for handling this: var startWithValid = function(value) {
assert(_.isDate(value), 'must be a valid Date');
return Joi.object().keys({
start: Joi.date().min(value).required()
});
}, And then I use it like: Joi.validate(input, startWithValid(new Date()), function (err, input) { ... |
@a00andos I am not using Joi API directly, but rather via Hapijs framework. Values passed in to min/max functions get cached. |
I think this one's been fixed in 4.8.0, closing. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
I want to validate input date to ensure it does not occur in the past.
Something like this...
Is there already a way to achieve this?
The text was updated successfully, but these errors were encountered: