2017 © Pedro Peláez
 

library php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

image

rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  • Tuesday, May 15, 2018
  • by rlanvin
  • Repository
  • 14 Watchers
  • 175 Stars
  • 183,791 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 25 Forks
  • 4 Open issues
  • 18 Versions
  • 20 % Grown

The README.md

RRULE for PHP

Lightweight and fast implementation of recurrence rules for PHP (RRULE from RFC 5545), to easily calculate recurring/repeating dates and events (such as in a calendar). This library started as a port of python-dateutil., (*1)

Build status Latest Stable Version Total Downloads, (*2)

Basic example

use RRule\RRule;

$rrule = new RRule([
    'FREQ' => 'MONTHLY',
    'INTERVAL' => 1,
    'DTSTART' => '2015-06-01',
    'COUNT' => 6
]);

foreach ($rrule as $occurrence) {
    echo $occurrence->format('D d M Y'),", ";
}
// Mon 01 Jun 2015, Wed 01 Jul 2015, Sat 01 Aug 2015, Tue 01 Sep 2015, Thu 01 Oct 2015, Sun 01 Nov 2015

echo $rrule->humanReadable(),"\n";
// monthly on the 1st of the month, starting from 01/06/2015, 6 times

Complete documentation and more examples are available in the wiki., (*3)

Requirements

  • PHP >= 5.6
  • intl extension is recommended for humanReadable() but not strictly required

Installation

The recommended way is to install the lib through Composer., (*4)

Simply run composer require rlanvin/php-rrule for it to be automatically installed and included in your composer.json., (*5)

Now you can use the autoloader, and you will have access to the library:, (*6)

require 'vendor/autoload.php';

Documentation

Complete documentation is available in the wiki., (*7)

You will also find useful information in the RFC 5545 section 3.3.10., (*8)

Contribution

Feel free to contribute! Just create a new issue or a new pull request., (*9)

The coding style is (mostly) PSR-2, but with tabs., (*10)

Translation

Use ./bin/review_translations.php --locale <locale> to print a list of examples using the locale specified (default is English). Use ./bin/review_translations.php --rule "<rule>" to test a specific rule in all available locales., (*11)

Note

I started this library because I wasn't happy with the existing implementations in PHP, so I thought it would be a good learning project to port the python-dateutil rrule implementation into PHP., (*12)

The Python lib was a bit difficult to understand because the algorithms are not commented and the variables are very opaque (I'm looking at you lno1wkst). I tried to comment and explain as much of the algorithm as possible in this PHP port, so feel free to check the code if you're interested., (*13)

The lib differs from the python version in various aspects, notably in the respect of the RFC. This version is a bit stricter and will not accept many non-compliant combinations of rule parts, that the python version otherwise accepts. There are also some additional features in this version., (*14)

License

This library is released under the MIT License., (*15)

The Versions

15/05 2018

dev-master

9999999-dev https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

13/04 2018

v1.6.1

1.6.1.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

22/02 2018

dev-php7.2

dev-php7.2 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

11/10 2017

v1.6.0

1.6.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

15/05 2017

v1.5.1

1.5.1.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

09/05 2017

dev-dev

dev-dev https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

07/05 2017

v1.5.0

1.5.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

11/04 2017

dev-issue26

dev-issue26 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

29/03 2017

dev-strtoupper

dev-strtoupper https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

29/03 2017

v1.4.2

1.4.2.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

date recurring rrule recurrence ical

02/02 2017

v1.4.1

1.4.1.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

11/11 2016

v1.4.0

1.4.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

09/08 2016

v1.3.1

1.3.1.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

08/07 2016

v1.3.0

1.3.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

09/04 2016

v1.2.0

1.2.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

30/03 2016

v1.1.0

1.1.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

11/03 2016

v1.0.1

1.0.1.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical

02/03 2016

v1.0.0

1.0.0.0 https://github.com/rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

date recurring rrule recurrence ical