SwarmOnline / Ext.ux.TouchCalendar

Sencha Touch Calendar component
113 stars 47 forks source link

Incorrect number of rows when month starts and ends on weekend #15

Open primski opened 11 years ago

primski commented 11 years ago

Example: June 2013 has one unnecessary row containing only days from July.

This updated function fixes the problem:

TouchCalendarView.js:804:809

getTotalDays: function(date){
    var firstDate = Ext.Date.getFirstDateOfMonth(date);
    var lastDate = Ext.Date.getLastDateOfMonth(date);

    return this.isWeekend(firstDate) && !this.isWeekend(lastDate) ? 42 : 35;
},