Added hourly chart logic for production in modules
This commit is contained in:
@@ -233,11 +233,15 @@ class ModuleFilterDataController extends Controller
|
|||||||
// ], 200);
|
// ], 200);
|
||||||
$chartName = $request->header('chart-name');
|
$chartName = $request->header('chart-name');
|
||||||
|
|
||||||
if ($chartName == 'Production Hourly Count') {
|
if ($chartName == 'Production Hourly Count')
|
||||||
|
{
|
||||||
$hourlyCounts = [];
|
$hourlyCounts = [];
|
||||||
|
|
||||||
$hourStart = $startDate->copy();
|
// Force start at 8:00 AM today
|
||||||
while ($hourStart < $endDate) {
|
$hourStart = now()->startOfDay()->addHours(8); // today 08:00 AM
|
||||||
|
$hourEndFinal = $hourStart->copy()->addDay(); // next day 08:00 AM
|
||||||
|
|
||||||
|
while ($hourStart < $hourEndFinal) {
|
||||||
$hourEnd = $hourStart->copy()->addHour();
|
$hourEnd = $hourStart->copy()->addHour();
|
||||||
|
|
||||||
$label = $hourStart->format('g:i A') . ' to ' . $hourEnd->format('g:i A');
|
$label = $hourStart->format('g:i A') . ' to ' . $hourEnd->format('g:i A');
|
||||||
|
|||||||
Reference in New Issue
Block a user