@@ 288-303 (lines=16) @@ | ||
285 | $jobMinutesInDay = $this->getJobMinutesInDay($nextJobDT->format('Y-m-d')); |
|
286 | ||
287 | // Если длинна дня больше чем время модификации |
|
288 | if ($jobMinutesInDay > $minutes) { |
|
289 | $nextJobDT->modify("+$minutes minutes"); |
|
290 | } else { // Если длинна дня меньше чем время модификации |
|
291 | ||
292 | do { |
|
293 | $nextJobDT->modify("+$jobMinutesInDay minutes"); |
|
294 | $minutes -= $jobMinutesInDay; |
|
295 | $nextWorkingTime = $this->nextWorkingTime($nextJobDT->format('Y-m-d H:i')); |
|
296 | $nextJobDT = new \DateTime($nextWorkingTime); |
|
297 | $jobMinutesInDay = $this->getJobMinutesInDay($nextJobDT->format('Y-m-d')); |
|
298 | if ($jobMinutesInDay > $minutes) { |
|
299 | $nextJobDT->modify("+$minutes minutes"); |
|
300 | $minutes = 0; |
|
301 | } |
|
302 | } while ($minutes > 0); |
|
303 | } |
|
304 | ||
305 | if ($date === null) { |
|
306 | $this->dateTime->setTimestamp($nextJobDT->getTimestamp()); |
|
@@ 314-329 (lines=16) @@ | ||
311 | ||
312 | $jobMinutesInDay = $this->getJobMinutesInDay($dateTime->format('Y-m-d')); |
|
313 | ||
314 | if ($jobMinutesInDay > $minutes) { |
|
315 | $dateTime->modify("+$minutes minutes"); |
|
316 | } else { // Если длинна дня меньше чем время модификации |
|
317 | ||
318 | do { |
|
319 | $dateTime->modify("+$jobMinutesInDay minutes"); |
|
320 | $minutes -= $jobMinutesInDay; |
|
321 | $nextWorkingTime = $this->nextWorkingTime($dateTime->format('Y-m-d H:i')); |
|
322 | $dateTime = new \DateTime($nextWorkingTime); |
|
323 | $jobMinutesInDay = $this->getJobMinutesInDay($dateTime->format('Y-m-d')); |
|
324 | if ($jobMinutesInDay > $minutes) { |
|
325 | $dateTime->modify("+$minutes minutes"); |
|
326 | $minutes = 0; |
|
327 | } |
|
328 | } while ($minutes > 0); |
|
329 | } |
|
330 | ||
331 | if ($date === null) { |
|
332 | $this->dateTime->setTimestamp($dateTime->getTimestamp()); |