From 0293e94757dea3e69b157138fbba92f0757d1313 Mon Sep 17 00:00:00 2001 From: go-faustino Date: Sun, 7 Jan 2018 01:50:19 +0000 Subject: [PATCH] cronjob calweek corrections --- application/modules/timemanagement/models/Users.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/modules/timemanagement/models/Users.php b/application/modules/timemanagement/models/Users.php index d5a697477..93a5334ce 100644 --- a/application/modules/timemanagement/models/Users.php +++ b/application/modules/timemanagement/models/Users.php @@ -141,6 +141,12 @@ public function checkweekdaysdatacron($hidstartweek_date,$hidendweek_date,$hidem $calWeekVal = strftime('%U',strtotime($loopDate)); $dateYearVal = strftime('%Y',strtotime($loopDate)); + + if($calWeekVal == "00") { + $prevYear = $dateYearVal - 1; + $calWeekVal = strftime('%U',strtotime($prevYear.'-12-31')); + } + if(!in_array($calWeekVal,$cal_weekArray)){ $cal_weekArray[] = $calWeekVal; $yearCalWeekArray[$calWeekVal][] = $dateYearVal;