From ad024894722fd15ba67a1acee64a2d85bc7cc398 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 18 May 2004 22:33:36 +0000 Subject: [PATCH] some fixes to use jscalendar without calendar-setup, eg. the original samples --- phpgwapi/js/jscalendar/calendar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpgwapi/js/jscalendar/calendar.js b/phpgwapi/js/jscalendar/calendar.js index 41dbd8b907..53bca46034 100644 --- a/phpgwapi/js/jscalendar/calendar.js +++ b/phpgwapi/js/jscalendar/calendar.js @@ -1158,7 +1158,7 @@ Calendar.prototype._init = function (firstDayOfWeek, date) { } this.ar_days = ar_days; // this.title.firstChild.data = Calendar._MN[month] + ", " + year; - this.title.firstChild.data = this.date.print(this.params.titleFormat); + this.title.firstChild.data = this.params ? this.date.print(this.params.titleFormat) : Calendar._MN[month] + ", " + year; this.onSetTime(); this.table.style.visibility = "visible"; // PROFILE @@ -1216,7 +1216,7 @@ Calendar.prototype.callHandler = function () { /** Calls the week-clicked user handler (selectedHandler). */ Calendar.prototype.hasWeekHandler = function () { - return this.params.flat && this.params.flatWeekCallback; + return this.params && this.params.flat && this.params.flatWeekCallback; }; Calendar.prototype.callWeekHandler = function (weekstart) { @@ -1227,7 +1227,7 @@ Calendar.prototype.callWeekHandler = function (weekstart) { /** Calls the week-clicked user handler (selectedHandler). */ Calendar.prototype.hasMonthHandler = function () { - return this.params.flat && this.params.flatMonthCallback; + return this.params && this.params.flat && this.params.flatMonthCallback; }; Calendar.prototype.callMonthHandler = function () { @@ -1582,7 +1582,7 @@ Calendar.prototype._displayWeekdays = function () { for (var i = 0; i < 7; ++i) { cell.className = "day name"; var realday = (i + fdow) % 7; - if (i && !this.params.disableFirstDowChange) { + if (i && !(this.params && this.params.disableFirstDowChange)) { cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); cell.navtype = 100; cell.calendar = this;