From: Jan Schneider Date: Thu, 4 Nov 2010 20:41:16 +0000 (+0100) Subject: Catch race condition where event dates are no longer matching current view. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f6abd2504f089642426c3de2ce32819dfb2956d9;p=horde.git Catch race condition where event dates are no longer matching current view. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 80b4b02da..d2464d8e2 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1490,8 +1490,16 @@ KronolithCore = { break; } - var day = dates[0].clone(), date, more, title, busy, events, monthDay; + var day = dates[0].clone(), + viewDates = this.viewDates(this.date, this.view), + date, more, title, busy, events, monthDay; while (!day.isAfter(dates[1])) { + // Skip if somehow events slipped in though the view is gone. + if (!day.between(viewDates[0], viewDates[1])) { + console.log(day, this.dates); + continue; + } + date = day.dateString(); switch (view) { case 'day':