From 8a472459fd413324cee0122eb212e8663e2fb8ed Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:18:15 +0200 Subject: [PATCH] [Contest Calendar] Fixed dupes during weekend --- application/controllers/Contestcalendar.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/application/controllers/Contestcalendar.php b/application/controllers/Contestcalendar.php index a6e512889..421b42dab 100644 --- a/application/controllers/Contestcalendar.php +++ b/application/controllers/Contestcalendar.php @@ -84,7 +84,7 @@ class Contestcalendar extends CI_Controller { $start = trim($parts[0]); $end = trim($parts[1]); - // create proper dateTime + // create proper dateTime $timeData['start'] = DateTime::createFromFormat('Hi\Z, M d', $start); $timeData['end'] = DateTime::createFromFormat('Hi\Z, M d', $end); } else { @@ -97,7 +97,7 @@ class Contestcalendar extends CI_Controller { // extract the date. we need to add this to the start time $date = substr($parts[1], strpos($parts[1], ',') + 2); - // create proper dateTime + // create proper dateTime $timeData['start'] = DateTime::createFromFormat('Hi\Z, M d', $start . ', ' . $date); $timeData['end'] = DateTime::createFromFormat('Hi\Z, M d', $end); } @@ -190,12 +190,10 @@ class Contestcalendar extends CI_Controller { } } if (!$contestExists) { - $contestsNextWeekend[] = $contest; - $contestsNextWeekend[] = $contest; $contestsNextWeekend[] = $contest; } } - + } return $contestsNextWeekend;