From f6abd2504f089642426c3de2ce32819dfb2956d9 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 4 Nov 2010 21:41:16 +0100 Subject: [PATCH] Catch race condition where event dates are no longer matching current view. --- kronolith/js/kronolith.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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': -- 2.11.0