Fix month-naming for different week arrangements

fixes #7179
This commit is contained in:
Matthias Jentsch 2014-09-12 11:50:51 +02:00
parent 6c3c466f92
commit 1932a912f8
1 changed files with 10 additions and 1 deletions

View File

@ -239,8 +239,11 @@ class HistoryColorGrid extends AbstractWidget {
if ($weekday > 6) {
$weekday = 0;
$weeks[] = array();
// PRESENT => The last day of week determines the month
if ($this->weekFlow === self::CAL_GROW_INTO_PRESENT) {
$months[$week] = $month;
}
$week++;
$months[$week] = $month;
}
if ($day > cal_days_in_month(CAL_GREGORIAN, $month, $year)) {
$month++;
@ -250,6 +253,12 @@ class HistoryColorGrid extends AbstractWidget {
}
$day = 1;
}
if ($weekday === 0) {
// PAST => The first day of each week determines the month
if ($this->weekFlow === self::CAL_GROW_INTO_PAST) {
$months[$week] = $month;
}
}
$date = $this->toDateStr($day, $month, $year);
$weeks[$week][$weekday] = $date;
};