emmett-framework / emmett

The web framework for inventors
BSD 3-Clause "New" or "Revised" License
1.06k stars 71 forks source link

Date validator #202

Closed josejachuf closed 7 years ago

josejachuf commented 7 years ago

Given a date field, if I apply the following validation:

'fecha': {'format': '%d/%m/%Y'}

It works well. When I edit the record from a Model.form the date is displayed and required in the format indicated.

Now, if the validation is the following:

'fecha': {'format': '%d/%m/%Y', 'allow': 'empty'},

In the Model.form, the validation works fine, but the date is displayed in this format: YYYY-MM-DD, which, before submitting, forces me to modify the value to DD/MM/YYYY

gi0baro commented 7 years ago

@josejachuf will inspect this shortly