In my application I am taking the locale value and then trying to replace shorter month names to full ones. Below is the code snippet
var localeCookie = $.cookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE");
if(localeCookie === null || localeCookie === undefined || localeCookie === "en") {
localeCookie = "";
}
$.datepicker.setDefaults( $.datepicker.regional[ localeCookie ] );
var completeMonthNames = $.datepicker.regional[ localeCookie ].monthNames;
How to make the above code work? I have looked up the variable "localeCookie" through firebug and it does take the language parameter like "fr", "de" etc. It works well for "en" default locale, but for other locales even when the debugger says that it has correct values, still the javascript says it cannot find definition. I have tried wrapping localeCookie around string like $.datepicker.regional[String(localeCookie)] but it still refuses to work?
What type constraint am I not reading in the JQeury documentation?
Aucun commentaire:
Enregistrer un commentaire