From 373559014d48fab70abd906a40d271c38fb9897b Mon Sep 17 00:00:00 2001 From: Nuno Date: Fri, 21 Oct 2016 11:02:37 +0100 Subject: [PATCH] readme update --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9e5feb6..184e3d8 100644 --- a/README.md +++ b/README.md @@ -47,16 +47,48 @@ foreach ($schedules as $schedule) { echo $schedule->format('Y-m-d H:i')."
"; } + +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 */ ```