2017 © Pedro Peláez
 

library time-scheduler

Time scheduler is a class to schedule timeslots by given time table

image

lezhnev/time-scheduler

Time scheduler is a class to schedule timeslots by given time table

  • Wednesday, January 13, 2016
  • by lezhnev74
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

TimeScheduler

Travis Scrutinizer Code Quality Packagist, (*1)

Class allows you to set weekdays and time stamps and pick next available for scheduling purposes., (*2)

Installation

Just run composer:, (*3)

composer require lezhnev/time-scheduler

Example

use TimeScheduler\Classes\TimeScheduler;

$scheduler = new TimeScheduler();

//if required set the last slot, so next one will be calculated from this time point
$now = strtotime("next Monday 12:00");
$scheduler->setLastTimeslot($now); 

// set Time table
$scheduler->setScheduleTimeSlots(
    [
        "Mon" => ["12:30", "12:40"],
        "Tue" => [],
        "Wed" => [],
        "Thu" => ["21:30"],
        "Fri" => [],
        "Sat" => [],
        "Sun" => [],
    ]
);

// iteratively call getNextTimeSlot() to get next slot from time table
$time1 = $scheduler->getNextTimeSlot(); 
$time2 = $scheduler->getNextTimeSlot();

date("H:i",$time1); // will be "12:30"
date("H:i",$time2); // will be "12:40"


Support

Please feel free to add PR or email me at lezhnev.work@gmail.com, (*4)

The Versions

13/01 2016

dev-master

9999999-dev

Time scheduler is a class to schedule timeslots by given time table

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

time schedule timetable

13/01 2016

1.0.0

1.0.0.0

Time scheduler is a class to schedule timeslots by given time table

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

time schedule timetable