2017 © Pedro Peláez
 

library calendar

Library for advanced operations with calendar days.

image

webtoucher/calendar

Library for advanced operations with calendar days.

  • Monday, October 9, 2017
  • by webtoucher
  • Repository
  • 1 Watchers
  • 1 Stars
  • 777 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Calendar

This library helps to calculate date difference considering holidays., (*1)

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

$ php composer.phar require webtoucher/calendar "*"

or add, (*5)

"webtoucher/calendar": "*"

to the require section of your composer.json file., (*6)

Usage

Create calendar for your country:, (*7)

$calendar = new Calendar(new Schedule('ru'));

Also you can use your external rules. Just create directory with your rules - e.x. 2016.json or default.json. Default rules will be used when rules for the year not exists. Use directory fullpath to init schedule., (*8)

$calendar = new Calendar(new Schedule('/var/www/my-site/rules/pl'));

Calculate number of working days with one of follow ways:, (*9)

echo $calendar->calendarToWorkingDays(new \DateTime('2016-02-24'), new \DateTime('2016-02-29')); // 3
echo $calendar->calendarToWorkingDays(new \DateTime('2016-02-29'), new \DateTime('2016-02-24')); // -3
echo $calendar->calendarToWorkingDays(new \DateTime('2016-02-24'), 5); // 3
echo $calendar->calendarToWorkingDays(new \DateTime('2016-02-29'), -5); // -3

Calculate number of calendar days by working days with one of follow ways:, (*10)

echo $calendar->workingToCalendarDays(new \DateTime('2016-02-24'), 3); // 5
echo $calendar->workingToCalendarDays(new \DateTime('2016-02-29'), -3); // -5

Additional information

You can help the project by adding rules for another countries. Send me your pull requests. But please use the same formating for json files., (*11)

The Versions

09/10 2017

dev-master

9999999-dev https://github.com/webtoucher/calendar

Library for advanced operations with calendar days.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Alexey Kuznetsov

date working days

05/05 2016

1.1.2

1.1.2.0 https://github.com/webtoucher/calendar

Library for advanced operations with calendar days.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Alexey Kuznetsov

date working days

30/03 2016

1.1.0

1.1.0.0 https://github.com/webtoucher/calendar

Library for advanced operations with calendar days.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Alexey Kuznetsov

date working days

30/03 2016

1.1.1

1.1.1.0 https://github.com/webtoucher/calendar

Library for advanced operations with calendar days.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

by Alexey Kuznetsov

date working days