Skip to content

Commit

Permalink
fix: make calendar widget show the correct number of weeks per month
Browse files Browse the repository at this point in the history
  • Loading branch information
brandoniffert committed Mar 8, 2013
1 parent 9868604 commit 4f14736
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion javascript/calendar_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
this.year = year;
this.firstDay = new Date(this.year, this.month, 1);
this.startingDay = this.firstDay.getDay();

this.daysUsed = this.firstDay.getDay() + this.settings.calDaysInMonth[this.month];

if($.CalendarWidget.settings.startOnMonday) {
this.startingDay--;
}
Expand Down Expand Up @@ -162,7 +165,7 @@

var cell = 1;
var empties = 0;
var row_count = Math.ceil(this.monthLength/7);
var row_count = Math.ceil(this.daysUsed/7);
for (var i = 0; i < row_count; i++) {
for (var j = 0; j <= 6; j++) {
date = "";
Expand Down

0 comments on commit 4f14736

Please sign in to comment.