{
  "path": "/posts/jquery-validation-globalize-hits-10",
  "site": "at://did:plc:yy3apqjlms24kso7ahn7lbmb/site.standard.publication/3mova7c4nho2b",
  "tags": [
    "globalize",
    "jquery"
  ],
  "$type": "site.standard.document",
  "title": "jQuery Validation Globalize hits 1.0",
  "description": "jQuery Validation Globalize plugin now supports Globalize 1.x, with minor code changes. Users can customize date parsing format.",
  "publishedAt": "2015-10-05T00:00:00.000Z",
  "textContent": "This is just a quick post - the tl;dr is this: jQuery Validation Globalize has been ported to Globalize 1.x. Yay! In one of those twists of fate I'm not actually using this plugin in my day job anymore but I thought it might be useful to other people. So here you go. You can read more about this plugin in an older post and you can see a demo of it in action here.\n\n\n\nThe code did not change drastically - essentially it was just a question of swapping parseFloat for parseNumber and parseDate for a slightly different parseDate. So, we went from this:\n\nTo this:\n\nAll of which is pretty self-explanatory. The only thing I'd like to draw out is that Globalize 0.1.x didn't force you to specify a date parsing format and, as I recall, would attempt various methods of parsing. For that reason jQuery Validation Globalize 1.0 exposes a $.validator.methods.dateGlobalizeOptions which allows you to specify the data parsing format you want to use. This means, should you be using a different format than the out of the box one then you can tweak it like so:\n\nTheoretically, this functionality could be tweaked to allow the user to specify multiple possible date parsing formats to attempt. I'm not certain if that's a good idea though, so it remains unimplemented for now.",
  "canonicalUrl": "https://johnnyreilly.com/posts/jquery-validation-globalize-hits-10"
}