Skip to content

Commit

Permalink
Update Scheduler.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Chaves committed Mar 20, 2016
1 parent 8f3c08c commit 3723df2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public function getNextSchedules( $fromDateStr = 'now', $limit = 5 )
foreach ($this->schedules as $schedule) {
$d = new \DateTime($fromDateStr);
for ($i=0; $i < $limit; ++$i) {
$dates[] = clone $d->modify($schedule);
$newDate = clone $d;
if ($newDate->modify($schedule) > $d) {
$dates[] = $newDate;
}
$d->modify($schedule);
}
}

Expand All @@ -93,4 +97,4 @@ private function orderDates( &$dates )
});
}

}
}

0 comments on commit 3723df2

Please sign in to comment.