Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno committed Oct 21, 2016
1 parent b042da2 commit 3735590
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,48 @@ foreach ($schedules as $schedule) {
echo $schedule->format('Y-m-d H:i')."<br/>";
}


examples :

$schedules = \Jupitern\Scheduler\Scheduler::instance()
->add('2030-01-01 12:35')
->add('2030-01-01 16:50')
->addRecurring('+2 hours')
->getNextSchedules('2016-01-01 00:00:00', 10);

/*
output:
2016-01-01 02:00
2016-01-01 04:00
2016-01-01 06:00
2016-01-01 08:00
2016-01-01 10:00
2016-01-01 12:00
2016-01-01 14:00
2016-01-01 16:00
2016-01-01 18:00
2016-01-01 20:00
*/

$schedules = \Jupitern\Scheduler\Scheduler::instance()
->setTimeFrame('08:00', '17:00')
->add('2030-01-01 12:35')
->add('2030-01-01 16:50')
->addRecurring('+2 hours')
->getNextSchedules('2016-01-01 00:00:00', 10);

/*
output:
2020-01-01 08:00
2020-01-01 12:35
2020-01-01 16:00
2020-01-02 08:00
2020-01-02 16:00
2020-01-03 08:00
2020-01-03 16:00
2020-01-04 08:00
2030-01-01 10:00
2030-01-01 12:00
2030-01-01 12:35
2030-01-01 14:00
2030-01-01 16:00
2030-01-01 16:50
2030-01-01 18:00
2030-01-02 10:00
2030-01-02 12:00
2030-01-02 14:00
*/

```
Expand Down

0 comments on commit 3735590

Please sign in to comment.