Display current weeks at the beginning of the history grid

fixes #7179
This commit is contained in:
Matthias Jentsch 2014-09-12 09:23:21 +02:00
parent 8ceef96d28
commit e42b7b3026
1 changed files with 10 additions and 1 deletions

View File

@ -15,10 +15,13 @@ use DateInterval;
*/
class HistoryColorGrid extends AbstractWidget {
const ORIENTATION_VERTICAL = 'vertical';
const CAL_GROW_INTO_PAST = 'past';
const CAL_GROW_INTO_PRESENT = 'present';
const ORIENTATION_VERTICAL = 'vertical';
const ORIENTATION_HORIZONTAL = 'horizontal';
public $weekFlow = self::CAL_GROW_INTO_PAST;
public $orientation = self::ORIENTATION_VERTICAL;
private $maxValue = 1;
@ -244,6 +247,12 @@ class HistoryColorGrid extends AbstractWidget {
$weeks[$week][$weekday] = $date;
};
$months[$week] = $month;
if ($this->weekFlow == self::CAL_GROW_INTO_PAST) {
return array(
'weeks' => array_reverse($weeks),
'months' => array_reverse($months)
);
}
return array(
'weeks' => $weeks,
'months' => $months