Skip to content

Instantly share code, notes, and snippets.

@danielmackay
Created July 19, 2013 05:45
Show Gist options
  • Save danielmackay/6036918 to your computer and use it in GitHub Desktop.
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.
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