Lib_Js_Calendar - Version 1.51.1

Version Notes

1.51.1

Download this release

Release Info

Developer Magento Core Team
Extension Lib_Js_Calendar
Version 1.51.1
Comparing to
See all releases


Code changes from version 1.51.0 to 1.51.1

js/calendar/calendar-setup.js CHANGED
@@ -18,4 +18,4 @@
18
* modify this code to suit your needs (this is recommended and much better
19
* than modifying calendar.js itself).
20
*/
21
- Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
18
* modify this code to suit your needs (this is recommended and much better
19
* than modifying calendar.js itself).
20
*/
21
+ Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();if(typeof fireEvent == 'function')fireEvent(p.inputField, "change");}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
js/calendar/calendar.js CHANGED
@@ -128,7 +128,7 @@ Calendar.getAbsolutePos = function(element) {
128
if (element) {
129
if (element.tagName.toUpperCase() == 'BODY') break;
130
var p = Calendar.getStyle(element, 'position');
131
- if (p !== 'static') break;
132
}
133
} while (element);
134
@@ -1898,8 +1898,8 @@ function CalendarDateObject() {
1898
dateObj = new this.parent.constructor(arguments[0]);
1899
} else {
1900
dateObj = new this.parent.constructor();
1901
- if (typeof(CalendarDateObject._LOCAL_TIMZEONE_OFFSET_SECONDS) != "undefined") {
1902
- dateObj.setTime(dateObj.getTime()+(CalendarDateObject._LOCAL_TIMZEONE_OFFSET_SECONDS - dateObj.getTimezoneOffset())*1000);
1903
}
1904
}
1905
return dateObj;
128
if (element) {
129
if (element.tagName.toUpperCase() == 'BODY') break;
130
var p = Calendar.getStyle(element, 'position');
131
+ if ((p !== 'static') && (p !== 'relative')) break;
132
}
133
} while (element);
134
1898
dateObj = new this.parent.constructor(arguments[0]);
1899
} else {
1900
dateObj = new this.parent.constructor();
1901
+ if (typeof(CalendarDateObject._SERVER_TIMZEONE_SECONDS) != "undefined") {
1902
+ dateObj.setTime((CalendarDateObject._SERVER_TIMZEONE_SECONDS + dateObj.getTimezoneOffset()*60)*1000);
1903
}
1904
}
1905
return dateObj;
package.xml CHANGED
@@ -1,18 +1,18 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Lib_Js_Calendar</name>
4
- <version>1.51.0</version>
5
<stability>stable</stability>
6
<license>Mixed</license>
7
<channel>community</channel>
8
<extends/>
9
<summary>Javascript Calendar for Magento</summary>
10
<description>Javascript Calendar for Magento</description>
11
- <notes>1.51.0</notes>
12
- <authors><author><name>Magento Core Team</name><user>auto-converted</user><email>core@magentocommerce.com</email></author></authors>
13
- <date>2010-02-12</date>
14
- <time>22:52:58</time>
15
- <contents><target name="mageweb"><dir name="js"><dir name="calendar"><dir name="skins"><dir name="aqua"><file name="active-bg.gif" hash="f8fb9f2b7428c94b41320aa1bc9cf601"/><file name="dark-bg.gif" hash="949f6a11667cbdfbb96f8986464ba81b"/><file name="hover-bg.gif" hash="803ac4dbc56c05739f515d6ac6a66163"/><file name="menuarrow.gif" hash="1f8c673c8f76832febaeeac88a5f4353"/><file name="normal-bg.gif" hash="851134e42206fd3b173a3db654981bb6"/><file name="rowhover-bg.gif" hash="c097de7289bcf68723e89c248b9a2749"/><file name="status-bg.gif" hash="123882ca533030f07ee55c3818fc46b9"/><file name="theme.css" hash="ec69465f70d45213258fe1f89c52eceb"/><file name="title-bg.gif" hash="8d652fc5b683706fcbbf1103131c6ac2"/><file name="today-bg.gif" hash="9befc7d912cad22ddf2ec3fc21188bfd"/></dir></dir><file name="calendar-blue.css" hash="b8bb29e3c1573d0d2917cd3112b5052d"/><file name="calendar-blue2.css" hash="654dfacebcdd70c75ccaf2b4aee2d059"/><file name="calendar-brown.css" hash="f326a6a84037e549a9cd71a92346f210"/><file name="calendar-green.css" hash="b44e2c25ff56efaa6e37d84df202e5d5"/><file name="calendar-setup.js" hash="1bd1051973ea17f452fd8fe966940452"/><file name="calendar-system.css" hash="9b446e2ee0e9e4420fce20922405cec7"/><file name="calendar-tas.css" hash="fa3baa9367504954ef03c1f05d44f1a6"/><file name="calendar-win2k-1.css" hash="e3c61212e6abc28844005381d8fe9690"/><file name="calendar-win2k-2.css" hash="332d8bc7dab6acd575dba49a15b62947"/><file name="calendar-win2k-cold-1.css" hash="b0810ce949e6c954c54053c52b21e74a"/><file name="calendar-win2k-cold-2.css" hash="3487ec4e054141057673d794ce6d1032"/><file name="calendar.js" hash="9bd3d66fb1226c4c1d6e9fde9fbb1294"/><file name="img.gif" hash="c1e5255bd358fcd5a0779a0cc310a2fe"/><file name="menuarrow.gif" hash="b5a91d7a2755198b2eb729541ad3288c"/><file name="menuarrow2.gif" hash="1f8c673c8f76832febaeeac88a5f4353"/></dir></dir></target></contents>
16
<compatible/>
17
- <dependencies><required><package><name>Mage_Pear_Helpers</name><channel>community</channel><min>1.0.18800</min><max></max></package></required></dependencies>
18
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Lib_Js_Calendar</name>
4
+ <version>1.51.1</version>
5
<stability>stable</stability>
6
<license>Mixed</license>
7
<channel>community</channel>
8
<extends/>
9
<summary>Javascript Calendar for Magento</summary>
10
<description>Javascript Calendar for Magento</description>
11
+ <notes>1.51.1</notes>
12
+ <authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
+ <date>2011-07-11</date>
14
+ <time>18:06:13</time>
15
+ <contents><target name="mageweb"><dir name="js"><dir name="calendar"><file name="calendar-blue.css" hash="b8bb29e3c1573d0d2917cd3112b5052d"/><file name="calendar-blue2.css" hash="654dfacebcdd70c75ccaf2b4aee2d059"/><file name="calendar-brown.css" hash="f326a6a84037e549a9cd71a92346f210"/><file name="calendar-green.css" hash="b44e2c25ff56efaa6e37d84df202e5d5"/><file name="calendar-setup.js" hash="0c21b9e48ecfad87b4c4885cfb1aca8d"/><file name="calendar-system.css" hash="9b446e2ee0e9e4420fce20922405cec7"/><file name="calendar-tas.css" hash="fa3baa9367504954ef03c1f05d44f1a6"/><file name="calendar-win2k-1.css" hash="e3c61212e6abc28844005381d8fe9690"/><file name="calendar-win2k-2.css" hash="332d8bc7dab6acd575dba49a15b62947"/><file name="calendar-win2k-cold-1.css" hash="b0810ce949e6c954c54053c52b21e74a"/><file name="calendar-win2k-cold-2.css" hash="3487ec4e054141057673d794ce6d1032"/><file name="calendar.js" hash="da368ae872efbf2394fbc9daadc4ab35"/><file name="img.gif" hash="c1e5255bd358fcd5a0779a0cc310a2fe"/><file name="menuarrow.gif" hash="b5a91d7a2755198b2eb729541ad3288c"/><file name="menuarrow2.gif" hash="1f8c673c8f76832febaeeac88a5f4353"/><dir name="skins"><dir name="aqua"><file name="active-bg.gif" hash="f8fb9f2b7428c94b41320aa1bc9cf601"/><file name="dark-bg.gif" hash="949f6a11667cbdfbb96f8986464ba81b"/><file name="hover-bg.gif" hash="803ac4dbc56c05739f515d6ac6a66163"/><file name="menuarrow.gif" hash="1f8c673c8f76832febaeeac88a5f4353"/><file name="normal-bg.gif" hash="851134e42206fd3b173a3db654981bb6"/><file name="rowhover-bg.gif" hash="c097de7289bcf68723e89c248b9a2749"/><file name="status-bg.gif" hash="123882ca533030f07ee55c3818fc46b9"/><file name="theme.css" hash="ec69465f70d45213258fe1f89c52eceb"/><file name="title-bg.gif" hash="8d652fc5b683706fcbbf1103131c6ac2"/><file name="today-bg.gif" hash="9befc7d912cad22ddf2ec3fc21188bfd"/></dir></dir></dir></dir></target></contents>
16
<compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
</package>