Avoid duplicate holiday events if a holiday is provided by more than one driver.
authorJan Schneider <jan@horde.org>
Tue, 22 Dec 2009 18:47:18 +0000 (19:47 +0100)
committerJan Schneider <jan@horde.org>
Tue, 22 Dec 2009 22:53:14 +0000 (23:53 +0100)
kronolith/js/kronolith.js

index e68b8b6..861189c 100644 (file)
@@ -20,6 +20,7 @@ KronolithCore = {
 
     view: '',
     ecache: $H(),
+    holidays: [],
     tcache: $H(),
     efifo: {},
     eventsLoading: {},
@@ -444,6 +445,8 @@ KronolithCore = {
      */
     updateView: function(date, view, data)
     {
+        this.holidays = [];
+
         switch (view) {
         case 'day':
             this.dayEvents = [];
@@ -1133,6 +1136,12 @@ KronolithCore = {
                     if (calendar != event.value.calendar) {
                         return;
                     }
+                    if (calendar.startsWith('holiday|')) {
+                        if (this.holidays.include(event.key)) {
+                            return;
+                        }
+                        this.holidays.push(event.key);
+                    }
                     break;
 
                 case 'year':