I have date field with date_text widget for year input ('Y' format).
Unfortunately, dateFormat validator doesn't respect on 'format' of Date field. Format can be found in Drupal.settings.clientsideValidation.forms.YOURFORM.rules.YOURDATEFIELD.dateFormat.format but it is not used for now.

Comments

Jelle_S’s picture

Status:Active» Fixed

Fixed in the latest dev version. Thanks for the report

kalabro’s picture

Category:bug» feature
Status:Fixed» Active

Maybe it should be feature request.
Validation for date formats like 'Y' still doesn't work. For now Clientside Validation requires day and month input for date fields.

Jelle_S’s picture

Did you try the latest version from git or from drupal.org? drupal.org takes +/- 12hours to sync with git so you might have been using the old version...

kalabro’s picture

StatusFileSize
new54.71 KB
new10.62 KB

Sure. I pulled latest 7.x-1.x.
I guess we didn't understand each other.
I have date field with date_text widget with custom format: http://drupal.org/files/2012-09-03_16-47-48.png
This format ignored in Javascript dateFormat validator: http://drupal.org/files/2012-09-03_16-49-45.png

kalabro’s picture

I think I could prepare a patch when I will have some free time. For now I just ignored validation for my date field.

Jelle_S’s picture

StatusFileSize
new5.72 KB
new33.78 KB

Have you cleared your cache? The 'format' is not really needed in the js code, as you can see in your screenshot, 'daypos' and 'monthpos' are both false, so we know we shouldn't expect a date part or a month part. here's what I have:

Settings:
Selection_003.pngForm:
Selection_004.png

kalabro’s picture

StatusFileSize
new22.3 KB

Hm.
I pulled code with git pull origin 7.x-1.x, cleared cache, tested in Firefox and Chrome.
It looks like this for me:
2012-09-03_17-10-29.png

So date is “Invalid Date” and false is returned.

kalabro’s picture

Status:Active» Fixed

oh, js wasn't updated! My fault!

Jelle_S’s picture

Status:Fixed» Active

Sorry about that, I committed but forgot to push... should really be fixed now.

Jelle_S’s picture

see ee02ea7

kalabro’s picture

StatusFileSize
new5.51 KB

I already got it, thanks! :)
I think we have to improve it.
2012-09-03_17-30-48.png

attiks’s picture

Assigned:Unassigned» Jelle_S
Jelle_S’s picture

Status:Active» Fixed

Fixed in latest dev version.

kpaxman’s picture

Status:Fixed» Active

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.

Liam Morland’s picture

Status:Active» Fixed

Status:Fixed» Closed (fixed)

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