mirror of
https://github.com/grocy/grocy.git
synced 2025-08-23 05:19:11 +00:00
Also show due/overdue on bateries- and habitoverview
This commit is contained in:
@@ -22,10 +22,16 @@ class BatteriesController extends BaseController
|
||||
$nextChargeTimes[$battery->id] = $this->BatteriesService->GetNextChargeTime($battery->id);
|
||||
}
|
||||
|
||||
$nextXDays = 5;
|
||||
$countDueNextXDays = count(FindAllItemsInArrayByValue($nextChargeTimes, date('Y-m-d', strtotime("+$nextXDays days")), '<'));
|
||||
$countOverdue = count(FindAllItemsInArrayByValue($nextChargeTimes, date('Y-m-d', strtotime('-1 days')), '<'));
|
||||
return $this->AppContainer->view->render($response, 'batteriesoverview', [
|
||||
'batteries' => $this->Database->batteries(),
|
||||
'current' => $this->BatteriesService->GetCurrent(),
|
||||
'nextChargeTimes' => $nextChargeTimes
|
||||
'nextChargeTimes' => $nextChargeTimes,
|
||||
'nextXDays' => $nextXDays,
|
||||
'countDueNextXDays' => $countDueNextXDays - $countOverdue,
|
||||
'countOverdue' => $countOverdue
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user