From a8ea220e2486ae1f20bf7fe58204d7d5294f5520 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 23 Jun 2023 10:03:06 +0700 Subject: [PATCH] Adjusting daysof into php format --- app/Models/VersionGantt.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/VersionGantt.php b/app/Models/VersionGantt.php index 236bff2..0784bbe 100644 --- a/app/Models/VersionGantt.php +++ b/app/Models/VersionGantt.php @@ -41,6 +41,10 @@ class VersionGantt extends Model public function updateActDuration(){ $daysOff = explode(',', $this->config_dayoff); + if (in_array('0', $daysOff)) { + $key = array_search('0', $daysOff, false); + $daysOff[$key] = '7'; + } $activities = Activity::where('version_gantt_id', $this->id)->get(); foreach ($activities as $value) { $startDate = new DateTime($value->start_date);