vendredi 11 mai 2018

Mutating date before saving in database

In my app, the user selects date from a datepicker and the date is then displayed in the input in a format that corresponds user's locale.

When the form is submitted, I would like to validate the respective date, however, the validator does not know the date format that the date was submitted in.

My question is whether I should mutate the date into Y-m-d before it is passed to validator or is there a way I can tell the Validator the right format to validate in?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2I6HaGp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire