only mark calendars as retrieved if _all_ the dates are cached
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 2 Dec 2010 06:02:35 +0000 (01:02 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 3 Dec 2010 05:48:51 +0000 (00:48 -0500)
kronolith/js/mobile.js

index d38c078..198a2de 100644 (file)
@@ -62,7 +62,6 @@
                 cals = cals[cal[1]];
                 c = cals[startDay.dateString()];
                 while (typeof c != 'undefined' && startDay.isBefore(endDay)) {
-                    KronolithMobile.loadedCalendars.push(cal.join('|'));
                     if (view != 'month') {
                         KronolithMobile.insertEvents([startDay, startDay], view, cal.join('|'));
                     }
@@ -72,7 +71,6 @@
 
                 c = cals[endDay.dateString()];
                 while (typeof c != 'undefined' && !startDay.isAfter(endDay)) {
-                    KronolithMobile.loadedCalendars.push(cal);
                     if (view != 'month') {
                         KronolithMobile.insertEvents([endDay, endDay], view, cal.join('|'));
                     }
@@ -80,6 +78,7 @@
                     c = cals[endDay.dateString()];
                 }
                 if (startDay.compareTo(endDay) > 0) {
+                    KronolithMobile.loadedCalendars.push(cal.join('|'));
                     return;
                 }
             }