@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $dateTime = $this->dateTime; |
136 | 136 | } else { |
137 | 137 | if (self::validateDate($time, 'H:i')) { |
138 | - $dateTime = new \DateTime($this->dateTime->format('Y-m-d') . ' ' . $time); |
|
138 | + $dateTime = new \DateTime($this->dateTime->format('Y-m-d').' '.$time); |
|
139 | 139 | } elseif (self::validateDate($time, 'Y-m-d H:i')) { |
140 | 140 | $dateTime = new \DateTime($time); |
141 | 141 | } else { |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | |
147 | 147 | list($jobStart, $jobSEnd) = explode('-', $this->workingDays[$dateTime->format('w')]); |
148 | 148 | |
149 | - $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart); |
|
150 | - $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobSEnd); |
|
149 | + $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart); |
|
150 | + $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobSEnd); |
|
151 | 151 | |
152 | 152 | if ($dateTime > $dtStart && $dateTime < $dtEnd) { |
153 | 153 | return true; |
@@ -199,28 +199,28 @@ discard block |
||
199 | 199 | $nextWorkingDay = $this->nextWorkingDay($dateTime->format('Y-m-d')); |
200 | 200 | $nWDateTime = new \DateTime($nextWorkingDay); |
201 | 201 | $workTime = explode('-', $this->workingDays[$nWDateTime->format('w')]); |
202 | - return $nextWorkingDay . ' ' . $workTime[0]; |
|
202 | + return $nextWorkingDay.' '.$workTime[0]; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | list($jobStart, $jobSEnd) = explode('-', $this->workingDays[$dateTime->format('w')]); |
206 | 206 | |
207 | 207 | if ($this->isWorkingDate($dateTime->format('Y-m-d'))) { // Если день рабочий проверяем время |
208 | 208 | |
209 | - $dtStart = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobStart); |
|
210 | - $dtEnd = new \DateTime($dateTime->format('Y-m-d') . ' ' . $jobSEnd); |
|
209 | + $dtStart = new \DateTime($dateTime->format('Y-m-d').' '.$jobStart); |
|
210 | + $dtEnd = new \DateTime($dateTime->format('Y-m-d').' '.$jobSEnd); |
|
211 | 211 | |
212 | 212 | // Если начало дня еще не наступило (утро) возвращаем указанную дату + время |
213 | 213 | if ($dateTime < $dtStart) { |
214 | - $nextWorkingTime = $dateTime->format('Y-m-d') . ' ' . $jobStart; |
|
214 | + $nextWorkingTime = $dateTime->format('Y-m-d').' '.$jobStart; |
|
215 | 215 | } elseif ($dateTime >= $dtEnd) { // Если рабочий день уже закончился |
216 | 216 | // Ищем следующий рабочий день и выводим его + время начало дня |
217 | - $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart; |
|
217 | + $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | } else { // Если день не рабочий |
221 | 221 | |
222 | 222 | // Ищем следующий рабочий день и выводим его + время начало дня |
223 | - $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')) . ' ' . $jobStart; |
|
223 | + $nextWorkingTime = $this->nextWorkingDay($dateTime->format('Y-m-d')).' '.$jobStart; |
|
224 | 224 | |
225 | 225 | } |
226 | 226 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | $nextWorkingTime = $this->nextWorkingTime($date ?? $this->dateTime->format('Y-m-d H:i')); |
247 | 247 | |
248 | - list($jobStart, $jobSEnd) = explode('-', $this->workingDays[(int)$day]); |
|
248 | + list($jobStart, $jobSEnd) = explode('-', $this->workingDays[(int) $day]); |
|
249 | 249 | // Считаем остаток рабочего времени |
250 | 250 | if (empty($nextWorkingTime)) { |
251 | 251 | $jobStart = ($date === null ? date('H:i', $this->dateTime->getTimestamp()) : date('H:i', |