getNextDay($this->getDayByNumber($number, 'en')); } public function getDayByNumber($number, $lang = 'fr') { return self::getDayByNumberStatic($number, $lang); } public static function getDayByNumberStatic($number, $lang = 'fr') { if ($lang == 'fr') { $daysArray = [ 1 => 'Lundi', 2 => 'Mardi', 3 => 'Mercredi', 4 => 'Jeudi', 5 => 'Vendredi', 6 => 'Samedi', 7 => 'Dimanche' ]; } else { $daysArray = [ 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday', ]; } if (isset($daysArray[$number])) { return $daysArray[$number]; } return ''; } // getDeliverySlotHour public function getHour(\DateTime $date) { $timestamp = $date->getTimestamp() ; $hour = $this->date('%kh', $timestamp) ; $minutes = $this->date('%M', $timestamp) ; if($minutes != '00') { $hour .= $minutes ; } return $hour ; } public function getTotalMinutes(\DateTimeInterface $time): int { return (int) $time->format('H') * 60 + (int) $time->format('i'); } }