Created
July 19, 2013 05:45
-
-
Save danielmackay/6036918 to your computer and use it in GitHub Desktop.
jQuery UI datepicker format issues in chrome. Add this after you have configured the datepicker to avoid date format problems.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod( | |
'date', | |
function (value, element, params) { | |
if (this.optional(element)) { | |
return true; | |
}; | |
var result = false; | |
try { | |
$.datepicker.parseDate('dd/mm/yy', value); | |
result = true; | |
} catch (err) { | |
result = false; | |
} | |
return result; | |
}, | |
'' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment