2017 © Pedro Peláez
 

library business-calendar

Manage working hours and events in a business calendar

image

krzystof/business-calendar

Manage working hours and events in a business calendar

  • Wednesday, April 19, 2017
  • by krzystof
  • Repository
  • 1 Watchers
  • 0 Stars
  • 316 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

business-calendar

Latest Unstable Version Build Status StyleCI Total Downloads, (*1)

Manage a business calendar with a working week, openings and events., (*2)

THIS IS NOT A STABLE PACKAGE AND SHOULD NOT BE USED IN PRODUCTION, (*3)

API

Calendar

In progress, (*4)

Working Week

$workingWeek->addOpening(new Opening([
    'day' => Carbon::MONDAY, 'time' => '06:00', 'length' => 12 * 3600
]));
$workingWeek->addOpening($opening2);

$workingWeek->countOpenings();           // returns the count of the openings
$workingWeek->isOpenAt(Carbon::now());   // returns bool
$workingWeek->workingHours();            // returns the sum of the working hours of the openings

<!-- r using a parser included: This is currently in development, (*5)

$workingWeek->addOpenings(FrenchOpeningParser::parse('le lundi de 8h a 18h'));
$workingWeek->addOpenings(EnglishOpeningParser::parse('from Monday to Friday, 9 to 5'));

The parsers returns an OpeningCollection, which can also be used when creating a new workingWeek:, (*6)

$ww = new WorkingWeek(FrenchOpeningParser::parse('lun mar mer 7-16'));-->

#### Opening
```php
$opening->opensAt();  // Return a Carbon instance
$opening->closesAt(); // Return a Carbon instance

// Check wether the two Openings overlaps:
$opening1->overlaps($opening2); // returns bool
// Merge them:
$opening1->merge($opening2);

// Get the day value to instantiate an opening
Opening::dayOfWeek('monday') // returns 1

Events

In progress, (*7)

Task

In progress, (*8)

BusinessTime

A couple of helpers to work with time and dates., (*9)

BusinessTime::dayFromString('Friday');  // returns 5
BusinessTime::dayToString(0);           // returns 'Sunday'
BusinessTime::hoursToSeconds(2);        // returns 7200
BusinessTime::secondsToHours(3600)      // returns 1

The Versions

19/04 2017

dev-master

9999999-dev https://github.com/krzystof/business-calendar

Manage working hours and events in a business calendar

  Sources   Download

MIT

The Requires

 

The Development Requires

19/04 2017

v0.3.1

0.3.1.0 https://github.com/krzystof/business-calendar

Manage working hours and events in a business calendar

  Sources   Download

MIT

The Requires

 

The Development Requires

12/02 2017

v0.3

0.3.0.0 https://github.com/krzystof/business-calendar

Manage working hours and events in a business calendar

  Sources   Download

MIT

The Requires

 

The Development Requires

21/06 2016

v0.2

0.2.0.0 https://github.com/krzystof/business-calendar

Manage working hours and events in a business calendar

  Sources   Download

MIT

The Requires

 

The Development Requires

19/12 2015

v0.1

0.1.0.0 https://github.com/krzystof/business-calendar

Manage working hours and events in a business calendar

  Sources   Download

MIT

The Requires