From 4f14736243ed287cf4b3f29d09faca022e457111 Mon Sep 17 00:00:00 2001 From: Brandon Iffert Date: Fri, 8 Mar 2013 13:38:09 -0500 Subject: [PATCH] fix: make calendar widget show the correct number of weeks per month --- javascript/calendar_widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/calendar_widget.js b/javascript/calendar_widget.js index 85febf6..430cf71 100755 --- a/javascript/calendar_widget.js +++ b/javascript/calendar_widget.js @@ -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--; } @@ -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 = "";