kpaxman wrote in #1765422: Date widget format ignored in clientside validation:

I've noticed that date validation fails when text is used instead of numbers, e.g. "Feb 1 2012".

I'm putting together a mapping but this is quite possibly not the best way.

Comments

Liam Morland’s picture

Status:Active» Needs review
StatusFileSize
new695 bytes

Fix attached.

Liam Morland’s picture

StatusFileSize
new735 bytes

Improved patch works with months expressed as numbers or letters.

attiks’s picture

Status:Needs review» Needs work

Thanks for the report and the patch, but I think it will be better if we get a list of months (and a list of abbreviations) from the server (stored in the settings.clientside_validation) so they can get easily translated.

Liam Morland’s picture

Status:Needs work» Needs review
StatusFileSize
new2.05 KB

Updated patch.

attiks’s picture

Looks good, I'll try to run some tests tomorrow and commit this

durum’s picture

Any progress on this?

attiks’s picture

Status:Needs review» Fixed

Committed to latest dev version, thanks

kpaxman’s picture

Status:Fixed» Needs review
StatusFileSize
new790 bytes

The previous patch(es) fail to resolve this issue. Here's a patch against the latest dev that does.

Note that in actual use I have to combine this with the patch from #1902840 so that it works on dates where the selected month is shorter than the current month.

Liam Morland’s picture

Thanks @kpaxman.

AndyZhang’s picture

The validation error message is as the following:
"The value in [field label] is not a valid date.".
I am posting the error message so that the ticket can be searchable by other search engines with the error message.

Jelle_S’s picture

Patch in #8 no longer applies, but it seems to have been fixed already in the latest dev. Can anyone confirm?

Jelle_S’s picture

Status:Needs review» Fixed

This has been fixed in the latest dev.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.