From 398b602d3c8f8defafd287c72103995f6b086280 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 7 Apr 2009 19:54:38 +0200 Subject: [PATCH] Fix _storeCache()/_deleteCache(). --- kronolith/js/src/kronolith.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index d46867609..502ca0f2e 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -947,9 +947,12 @@ KronolithCore = { // Create empty cache entries for all dates. if (typeof dates != 'undefined') { var start = Date.parseExact(dates.substr(0, 8), 'yyyyMMdd'), - end = Date.parseExact(dates.substr(8, 8), 'yyyyMMdd'); + end = Date.parseExact(dates.substr(8, 8), 'yyyyMMdd'), + calHash = this.ecache.get(calendar[0]).get(calendar[1]); while (start.compareTo(end) <= 0) { - this.ecache.get(calendar[0]).get(calendar[1]).set(start.dateString(), {}); + if (!calHash.get(start.dateString())) { + calHash.set(start.dateString(), {}); + } start.add(1).day(); } } @@ -982,7 +985,7 @@ KronolithCore = { return; } this.ecache.get(calendar[0]).get(calendar[1]).each(function(day) { - day.value.unset(event); + delete day.value[event]; }); }, -- 2.11.0