From 39a8fd6b40ea8bc01c3f9710d09f341c71551cb8 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Mon, 3 Jul 2023 16:55:30 +0700 Subject: [PATCH] Fix progress --- app/Helpers/MasterFunctionsHelper.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 1a07007..54af18a 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -99,11 +99,8 @@ class MasterFunctionsHelper { $maxDate = Project::select('akhir_proyek')->where('id', $request->project_id)->first(); $begin = new \DateTime($minDate->mulai_proyek. ' Monday'); - $begin->modify('last Monday'); $end = new \DateTime($maxDate->akhir_proyek. ' Friday'); - $end->modify('next Friday'); - $end->modify('next Friday'); $interval = new \DateInterval('P7D'); @@ -118,13 +115,14 @@ class MasterFunctionsHelper { $dates = []; $tempProgress = 0; $tempPlanning = 0; - + array_push($progressData, round($tempProgress, 2)); + array_push($planningData, round($tempPlanning, 2)); foreach($period as $p){ - array_push($progressData, $tempProgress); - array_push($planningData, $tempPlanning); - array_push($dates, $p->format("Y-m-d")); $tempProgress += $avgProgress; $tempPlanning += $avgPlanning; + array_push($progressData, round($tempProgress, 2)); + array_push($planningData, round($tempPlanning, 2)); + array_push($dates, $p->format("Y-m-d")); } $dataResponse = array(