Resolving “_59f.getMonth is not a function” in Spring Roo Dojo integration

At some point we started getting “_59f.getMonth is not a function” JavaScript issue each time we render forms with the dijit.form.DateTextBox. Further investigation showed that the issue happens just in FireFox and not in Chromium. So I’ve configured unobfuscated Dojo and Spring JS files and started debugging comparing things in two browsers.

Pretty soon it became vivid that in Chrome we get Date object for parsing while in Firefox we got String object. After a bit of debugging I’ve seen that localization data used for initialization of date formats was really different.

Firefox:

months-format-abbr:["1","2","3","4","5","6","7","8","9","10","11","12"]

Chromium:

months-format-abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

Digging further showed that Firefox was loading dojo_ROOT.js while Chrome was loading dojo_en-us.js. And the finally the mistery was uncovered. So who can find an issue here?

var djConfig = {parseOnLoad: false: false, locale: '${fn:toLowerCase(userLocale)}'};

Yeah, it’s the name of the variable. Dojo expects dojoConfig, not djConfig. Changing code and the error is vanished:

var dojoConfig = {parseOnLoad: false, locale: '${fn:toLowerCase(userLocale)}'};
Advertisements
This entry was posted in Development and tagged , , , , , , . Bookmark the permalink.

One Response to Resolving “_59f.getMonth is not a function” in Spring Roo Dojo integration

  1. chaitanya says:

    but it is not vanished

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s