Skip to content

Instantly share code, notes, and snippets.

@pparadis
Last active July 9, 2016 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pparadis/d8643555f5ba11bb824c60094745f4b1 to your computer and use it in GitHub Desktop.
Save pparadis/d8643555f5ba11bb824c60094745f4b1 to your computer and use it in GitHub Desktop.
$.when(
$.get( "cldr/main/en/ca-gregorian.json" ),
$.get( "cldr/main/fr/ca-gregorian.json" ),
$.get( "cldr/supplemental/likelySubtags.json" ),
$.get( "cldr/supplemental/timeData.json" ),
$.get( "cldr/supplemental/weekData.json" )
).then(function() {
return [].slice.apply( arguments, [ 0 ] ).map(function( result ) {
return result[ 0 ];
});
}).then( Globalize.load );
//Instantier jQuery.Globalize dans une culture
Globalize("en") //Cette culture peut être fournie par votre backend MVC, par exemple System.Threading.Thread.CurrentThread.CurrentCulture
//L'initialisation des règles peronnalisées pour jQuery.Validate se fait ici.
$.validator.methods.date = function (value, element) {
return this.optional(element) || Globalize.parseDate(value);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment