Magento Forum

Calendar JS broken in Magento 1.1.8
 
jdetamore
Jr. Member
 
Total Posts:  1
Joined:  2008-10-22
 

Hi,

I have recently upgraded my Magento 1.1.6 install to 1.1.8 through Magento Connect. Since then I am unable to use the JavaScript Calendar for reports etc.

This is the JS error I’m getting.

enUS is not defined

I’ve searched through the entire JS folder and the only place enUS is used is in /js/calendar/calendar.js around line 1594.

I have gone to Magento Connect and reinstalled the most recent version of Calendar JS (Lib_Js_Calendar 1.1.7) a couple of times already. I also have a separate install of Magento that was upgraded from 1.1.4 to 1.1.8 through Magento Connect and the Calendar JS works perfectly on it.

Anyone have any ideas?

Thanks,

Jason

 
Magento Community Magento Community
Magento Community
Magento Community
 
IcebergCommerce
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2008-06-24
 

i was getting the same error.  try a full cache refresh.  you could also delete everything in your magento/var/cache folder.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixeldust
Jr. Member
 
Total Posts:  1
Joined:  2008-05-24
 

Hi,

I also had this problem after upgrading from 1.1.8. It would appear that the Magento development team patched part of the calendar.js code to extend the localisation capabilities. Previously all of the locale values for the calendar were obtained by linking in the appropriate Javascript file from the calendar/lang/ folder, e.g. calendar-en.js for US English. Since 1.1.8 calendar.js requires a new variable called enUS and two new properties for the calendar instance, _am and _pm.

Values for these need to be set before the calendar will work again.

To do this I followed the same approach as used in the Admin pages where the calendar widget is still working. I simply defined these values inline before creating the calendar object. For example,

<script type="text/javascript">
//<![CDATA[

enUS {"m":{"wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}// en_US locale reference
Calendar._am "AM"// am/pm
Calendar._pm "PM";

Calendar.setup({
    inputField
"calendar-deldate",
    
ifFormat"%d/%m/%Y",
    
showsTimefalse,
    
button"calendar-deldate_trig",
    
align"Bl",
    
singleClick true,
    
firstDay1
}
);

//]]>
</script>
 
Magento Community Magento Community
Magento Community
Magento Community
 
jesse_dev
Jr. Member
 
Total Posts:  27
Joined:  2009-03-03
 

I had to track down the lang folder for some reason.

I just had to download the source of the calendar from http://www.dynarch.com/static/jscalendar-1.0.zip

this worked for me

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top