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