roojs-calendar.js
[roojs1] / roojs-calendar-debug.js
index 3efeda3..5d9ad08 100644 (file)
@@ -554,8 +554,9 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
         this.store.on('load', this.onLoad, this);
         
         this.resize();
-        this.cells = this.el.select('.fc-day',true);
         
+        this.cells = this.el.select('.fc-day',true);
+        //Roo.log(this.cells);
         this.textNodes = this.el.query('.fc-day-number');
         this.cells.addClassOnOver('fc-state-hover');
         
@@ -636,7 +637,7 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
             startingPos += 7;
         }
         
-        var pm = date.add("mo", -1);
+        var pm = date.add(Date.MONTH, -1);
         var prevStart = pm.getDaysInMonth()-startingPos;
 //        
         this.cells = this.el.select('.fc-day',true);
@@ -655,6 +656,10 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
         // convert everything to numbers so it's fast
         var day = 86400000;
         var d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart)).clearTime();
+        //Roo.log(d);
+        //Roo.log(pm);
+        //Roo.log(prevStart);
+        
         var today = new Date().clearTime().getTime();
         var sel = date.clearTime().getTime();
         var min = this.minDate ? this.minDate.clearTime() : Number.NEGATIVE_INFINITY;
@@ -666,9 +671,13 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
         var format = this.format;
         
         var setCellClass = function(cal, cell){
+            
+            //Roo.log('set Cell Class');
             cell.title = "";
             var t = d.getTime();
             
+            //Roo.log(d);
+            
             cell.dateValue = t;
             if(t == today){
                 cell.className += " fc-today";
@@ -794,10 +803,12 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
     
     findCells : function(ev) {
         var s = ev.start.clone().clearTime().getTime();
+       // Roo.log(s);
         var e= ev.end.clone().clearTime().getTime();
+       // Roo.log(e);
         var ret = [];
         this.cells.each(function(c){
-            //Roo.log("check " +c.dateValue + '<' + e + ' > ' + s);
+             ////Roo.log("check " +c.dateValue + '<' + e + ' > ' + s);
             
             if(c.dateValue > e){
                 return ;
@@ -984,7 +995,7 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
     onLoad: function () {
         
         this.clearEvents();
-        Roo.log('calendar onload');
+        //Roo.log('calendar onload');
 //        
         this.calevents = [];
         var cal = this;
@@ -1111,6 +1122,9 @@ Roo.CalendarPanel = function(config){
 
 
 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
+    
+    startDay : 0,
+    
     getId : function(){
         return this.id;
     },
@@ -1193,9 +1207,6 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
     },
     
     
-    getAutoCreate : Roo.bootstrap.Calendar.prototype.getAutoCreate,
-    
-    initEvents : Roo.bootstrap.Calendar.prototype.initEvents 
     
     
 });