Jquery Validation plugin validate date like 20/August/2013 Safari Bug?
jquery, jquery-validate, regex, safari, validation
Solution
As you said if you are using `JqueryUi Datepicker` u have 2 ways
1) As @hwnd said you have to edit the validator plugin 2) Just add my hack below and happy with it !
/*Override the validator's Date Validation with mine! */
$.validator.methods.date=
function(value, element) {
try{
var _appleDates=$.datepicker.formatDate("mm/dd/yy",$.datepicker.parseDate("dd/MM/yy",value));
return (!/Invalid|NaN/.test(new Date(_appleDates).toString()));
}catch(e){return false;};
};
then use as you said
rules:{
eventdate:
{
required:true,
date: true
}
}
Thank you Be happy !
Problem
i use Jquery Validation plugin and validates an event date like ``` rules:{ eventdate: { required:true, date: true } } ``` date format is like "23/August/2013" ('dd/MM/yy') but the code fails on Safari , works better with Fx,chrome,opera... is it a Safari Bug or a Jquery Validation plugin bug ? i know that Jquery Validation plugin supports custom validation like ``` $.validator.addMethod("customdateValidateRule", function(value, element) { _isvalidResult=****testfn()***; return _isvalidResult; } ``` i tried Custom date format with jQuery validation plugin but wouldn't helped as its in `dd/mm/yyyy` not for `('dd/MM/yy')` ,but regex for "`23/August/2013"` that i don't know! Remarks 1) I use Datepicker(JqueryUi) for selecting the date 2) i am using Jquery Validation plugin (latest) it will validate a lot of date formats it also validates "23/August/2013" (i assume) but when i test it in Safari it shows invalid where shown "valid" in FX,Chrome,Opera..