PDA

View Full Version : Need help to understand calendar piece of code



Jair_Apdata
3 Apr 2013, 6:30 AM
Hi, everyone.

I need help to understand a piece of code in calendar extjs component (calendar-all.js) that cause a strange behavior in my application.


The remark below "//current week is fully in next month so skip" does exactly what it says, but i don't understand why.


Could somebody explain the meaning of that condition ?


In my application, when April month is loaded, this code skips entirely my attached events, showing all of them empty.


I would appreciate your help






for (; w < weeks; w++) {
this.evtMaxCount[w] = 0;
if (this.weekCount == -1 && dt.getDate() > lastInMonth.getDate()) {
//current week is fully in next month so skip
break;
}
this.eventGrid[w] = this.eventGrid[w] || [];
this.allDayGrid[w] = this.allDayGrid[w] || [];


for (d = 0; d < this.dayCount; d++) {
if (evtsInView.getCount() > 0) {
var evts = evtsInView.filterBy(function(rec) {
var startsOnDate = (dt.getTime() == rec.data[Ext.calendar.EventMappings.StartDate.name].getTime()); //inserido esta linha por causa do horario de ver?o.. pendencia 152892 avitorino
var spansFromPrevView = (w == 0 && d == 0 && (dt > rec.data[Ext.calendar.EventMappings.StartDate.name]));
return startsOnDate || spansFromPrevView;
},
this);


this.sortEventRecordsForDay(evts);
this.prepareEventGrid(evts, w, d);
}
dt = dt.add(Date.DAY, 1);
}
}
this.currentWeekCount = w;
},

slemmon
5 Apr 2013, 1:25 PM
Sencha distributes the calendar as an example, but didn't actually create it.
For more insights you might post your question to:
http://ext.ensible.com/forum/


(http://ext.ensible.com/forum/)

Jair_Apdata
6 Apr 2013, 5:41 AM
Ok, i'll go forward with it.
Thanks for your help.