2017 © Pedro Peláez
 

library timeslot

A PHP library for managing timeslots.

image

gpaddis/timeslot

A PHP library for managing timeslots.

  • Friday, November 3, 2017
  • by gpaddis
  • Repository
  • 0 Watchers
  • 1 Stars
  • 452 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Timeslot

A simple yet flexible timeslot management API., (*1)

Build Status, (*2)

Warning: this library is in development and might change significantly before v1.0 is released., (*3)

Timeslot uses Carbon to manage date and time. You can create a new timeslot passing it a Carbon instance, a DateTime instance or a valid datetime string instead. The complete syntax is new Timeslot($start, $hours, $minutes). Fluent methods, getters and setters are available as well., (*4)

To get started, read the documentation in the library wiki., (*5)

Examples

// Create a 30-minutes timeslot from a string starting at 15:00
$timeslot = new Timeslot('2017-08-19 15:00:00', 0, 30);

// Get its start and end time as datetime strings (Carbon)
$timeslot->start()->toDateTimeString(); // 2017-08-19 15:00:00
$timeslot->end()->toDateTimeString();   // 2017-08-19 15:29:59

// Create a TimeslotCollection based on the $timeslot, containing 4 timeslots
$collection = TimeslotCollection::create($timeslot, 4);

// A TimeslotCollection has a start and end time as well...
$collection->start()->toDateTimeString(); // 2017-08-19 15:00:00
$collection->end()->toDateTimeString();   // 2017-08-19 16:59:59 (2 hours later)

// ...and you can get the single timeslots if you want.
$collection->get(1)->start()->toDateTimeString(); // 2017-08-19 15:30:00 (second timeslot in the collection)

Check the wiki for a full description of all available methods., (*6)

The Versions

03/11 2017

dev-master

9999999-dev

A PHP library for managing timeslots.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianpiero Addis

22/09 2017

dev-develop

dev-develop

A PHP library for managing timeslots.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianpiero Addis

22/09 2017

v0.2

0.2.0.0

A PHP library for managing timeslots.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianpiero Addis

19/09 2017

v0.1

0.1.0.0

A PHP library for managing timeslots.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gianpiero Addis