You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to check that day, start_time, end_time are in valid date formats. but I'd like the output of the validation to still be strings (as long as they are valid) because thats the format my database is expecting them in, and adding another transformation layer/function somewhere else in the app seems error prone.
The only work around I can think of is to attempt to regex the incoming strings but that feels semantically wrong and also prone to errors.
Let me know if this isn't clear, or you think is too much of edge case, or just better handled outside of Joi
The text was updated successfully, but these errors were encountered:
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.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a way to apply a
Joi.date().format()
to a string so that it will validate it but not transform the value into a date object?The context of this is that I have a hapijs app with a controller that looks roughly like this.
I'd like to check that
day
,start_time
,end_time
are in valid date formats. but I'd like the output of the validation to still be strings (as long as they are valid) because thats the format my database is expecting them in, and adding another transformation layer/function somewhere else in the app seems error prone.The only work around I can think of is to attempt to regex the incoming strings but that feels semantically wrong and also prone to errors.
Let me know if this isn't clear, or you think is too much of edge case, or just better handled outside of Joi
The text was updated successfully, but these errors were encountered: