Highlight minical days when navigating back to the current month.
authorJan Schneider <jan@horde.org>
Fri, 6 Nov 2009 15:52:30 +0000 (16:52 +0100)
committerJan Schneider <jan@horde.org>
Fri, 6 Nov 2009 15:52:30 +0000 (16:52 +0100)
kronolith/js/kronolith.js

index f2efbc9..3ce887b 100644 (file)
@@ -2011,17 +2011,18 @@ KronolithCore = {
                 return;
 
             case 'kronolithMinical':
+                var today = new Date();
                 if (orig.id == 'kronolithMinicalPrev') {
                     var date = this.parseDate($('kronolithMinicalDate').retrieve('date'));
                     date.previous().month();
-                    this.updateMinical(date);
+                    this.updateMinical(date, date.getMonth() == today.getMonth() ? this.view : undefined);
                     e.stop();
                     return;
                 }
                 if (orig.id == 'kronolithMinicalNext') {
                     var date = this.parseDate($('kronolithMinicalDate').retrieve('date'));
                     date.next().month();
-                    this.updateMinical(date);
+                    this.updateMinical(date, date.getMonth() == today.getMonth() ? this.view : null);
                     e.stop();
                     return;
                 }