From 7e3fa85a00d2598ad7653fc07de05af77558a824 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sat, 27 Aug 2011 20:23:16 +0200 Subject: [PATCH] Fix displaying events in month view --- apps/calendar/js/calendar.js | 12 ++++++------ apps/calendar/js/calendar_init.js | 12 +++++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 82e0c3592c..116c571765 100755 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -764,8 +764,8 @@ function oc_cal_load_events(loadview) { var weekdaynum = 0; var weeknum = 1; for(var i = 0; i <= 41; i++) { - var loadevents_month = dates[i][0]; - var loadevents_days = dates[i][1]; + var loadevents_month = dates[i][1]; + var loadevents_days = dates[i][0]; if( typeof (oc_cal_events[oc_cal_year][loadevents_month]) != "undefined") { if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days]) != "undefined") { var pnum = 0; @@ -786,12 +786,12 @@ function oc_cal_load_events(loadview) { if( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time]) != "undefined") { var eventnumber = 1; var eventcontainer = document.getElementById("events_onemonthview_" + weekdays[weekdaynum] + "_" + weeknum); - while( typeof (oc_cal_events[year][loadevents_month][loadevents_days][i][eventnumber]) != "undefined") { + while( typeof (oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time][eventnumber]) != "undefined") { var newp = document.createElement("p"); - newp.id = "onemonthview_" + i + "_" + eventnumber; + newp.id = "onemonthview_" + time + "_" + eventnumber; newp.className = "onemonthview_event"; eventcontainer.appendChild(newp); - document.getElementById("onemonthview_" + i + "_" + eventnumber).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][i][eventnumber]["description"]; + document.getElementById("onemonthview_" + time + "_" + eventnumber).innerHTML = oc_cal_events[oc_cal_year][loadevents_month][loadevents_days][time][eventnumber]["description"]; eventnumber++; pnum++; } @@ -892,4 +892,4 @@ function oc_cal_choosecalendar(){ }else{ alert(t("calendar", "You can't open more than one dialog per site!")); } -} \ No newline at end of file +} diff --git a/apps/calendar/js/calendar_init.js b/apps/calendar/js/calendar_init.js index 3b5d37161c..72837f7a8b 100755 --- a/apps/calendar/js/calendar_init.js +++ b/apps/calendar/js/calendar_init.js @@ -52,8 +52,14 @@ var oc_cal_opendialog = 0; var oc_cal_datemonthyear = String(oc_cal_dayofmonth) + String(oc_cal_month) + String(oc_cal_year); var oc_cal_calendars = new Array(); //event vars -var oc_cal_events = new Array(2011); -oc_cal_events[2011] = new Array(0,1,2,3,4,5,6,7,8,9,10,11); +var oc_cal_events = new Array(); +oc_cal_events[2011] = new Array(); oc_cal_events[2011][7] = new Array(); oc_cal_events[2011][7][7] = new Array(); -oc_cal_events[2011][7][13] = new Array(); \ No newline at end of file +oc_cal_events[2011][7][7]['allday'] = new Array(); +oc_cal_events[2011][7][7]['allday'][1] = new Array(); +oc_cal_events[2011][7][7]['allday'][1]['description'] = 'allday event'; +oc_cal_events[2011][7][13] = new Array(); +oc_cal_events[2011][7][13][10] = new Array(); +oc_cal_events[2011][7][13][10][1] = new Array(); +oc_cal_events[2011][7][13][10][1]['description'] = '10:00 event';