close #265 Fixed: Dashboard 'Last 12 months' does not work, 'Custom Range' partially broken
This commit is contained in:
@ -126,6 +126,7 @@ class Dashboard extends Controller
|
||||
$start = Date::parse(request('start', $this->today->startOfYear()->format('Y-m-d')));
|
||||
$end = Date::parse(request('end', $this->today->endOfYear()->format('Y-m-d')));
|
||||
$period = request('period', 'month');
|
||||
$range = request('range', 'custom');
|
||||
|
||||
$start_month = $start->month;
|
||||
$end_month = $end->month;
|
||||
@ -135,6 +136,11 @@ class Dashboard extends Controller
|
||||
|
||||
$s = clone $start;
|
||||
|
||||
if ($range == 'last_12_months') {
|
||||
$end_month = 12;
|
||||
$start_month = 1;
|
||||
}
|
||||
|
||||
for ($j = $end_month; $j >= $start_month; $j--) {
|
||||
$labels[$end_month - $j] = $s->format('M Y');
|
||||
|
||||
|
Reference in New Issue
Block a user