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.
7 posts tagged with "globalize"
View All TagsUpgrading to Globalize 1.x for Dummies
Globalize has hit 1.0. Anyone who reads my blog will likely be aware that I'm a long time user of Globalize 0.1.x. I've been a little daunted by the leap that the move from 0.1.x to 1.x represents. It appears to be the very definition of "breaking changes". :-) But hey, this is Semantic Versioning being used correctly so how could I complain? Either way, I've decided to write up the migration here as I'm not expecting this to be easy.
Knockout + Globalize = valueNumber Binding Handler
I’ve long used Globalize for my JavaScript number formatting / parsing needs. In a current project I’m using Knockout for the UI. When it came to data-binding numeric values none of the default binding handlers seemed appropriate. What I wanted was a binding handler that:
DecimalModelBinder for nullable Decimals
My memory appears to be a sieve. Twice in the last year I've forgotten that MVCs ModelBinding doesn't handle regionalised numbers terribly well. Each time I've thought "hmmmm.... best Google that" and lo and behold come upon this post on the issue by the fantastic Phil Haack:
Twitter.Bootstrap.MVC4 meet Bootstrap Datepicker *and* get your Internationalization on...
Last time I wrote about marrying up Twitter.Bootstrap.MVC4 and Bootstrap Datepicker. It came together quite nicely but when I took a more in depth look at what I'd done I discovered a problem. The brief work on regionalisation / internationalisation / localisation / globalisation / whatever it's called this week... wasn't really working. We had problems with the validation.
Globalize and jQuery Validation
Updated 05/10/2015
If you're after a version of this that works with Globalize 1.x then take a look here.
Updated 27/08/2013
To make it easier for people to use the approach detailed in this post I have created a repository for jquery.validate.globalize.js
on GitHub here.
This is also available as a nuget package here.
To see a good demo take a look here.
Globalize.js - number and date localisation made easy
I wanted to write about a JavaScript library which seems to have had very little attention so far. And that surprises me as it's