2017 © Pedro Peláez
 

library date-frequency

Temporal frequency library

image

smhg/date-frequency

Temporal frequency library

  • Friday, June 8, 2018
  • by smhg
  • Repository
  • 1 Watchers
  • 2 Stars
  • 54 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 2 % Grown

The README.md

date-frequency-php Build status

Temporal frequency library, (*1)

PHP clone of JavaScript version., (*2)

Installation

$ composer require smhg/date-frequency

Methods

Frequency

use Frequency\Frequency;

$frequency = new Frequency();
$frequency->on('day', 3, 'week')
    ->on('hour', 10)
    ->on('minute', 0)
    ->on('seconds', 0); // every Wednesday at 10:00:00

Frequency([string rules])

Frequency([array rules])

Pass rules as a string (see __toString) or an array to the constructor instead of setting them one-by-one with on()., (*3)

Example above as a string: $frequency = new Frequency('F3D/WT10H0M0S');, (*4)

on(string unit, int|string value, [string scope])

Add a rule (fixed integer value or a string representing the name of a filter function) to the frequency for a unit, optionally linked to a scope (if not provided, a default scope is derived)., (*5)

Filter functions need to be available in the static Frequency::$fn array when used., (*6)

Example filter: $frequency = new Frequency('F(leap)Y1M1DT0H0M0S'); (Jan 1st, at midnight, of leap years), (*7)

See tests for more examples., (*8)

next(DateTime start = new DateTime())

Get the next occurence of the frequency on or after a date., (*9)

between(DateTime start, DateTime end)

Get all occurences of the frequency between 2 dates., (*10)

__toString()

Convert frequency to a string value., (*11)

The Versions

08/06 2018

dev-master

9999999-dev

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

08/06 2018

v1.0.0

1.0.0.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

04/03 2016

v0.3.1

0.3.1.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

28/04 2015

v0.3.0

0.3.0.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

17/08 2014

v0.2.1

0.2.1.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

16/08 2014

v0.2.0

0.2.0.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

08/03 2014

0.1.6

0.1.6.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

08/03 2014

0.1.5

0.1.5.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

03/03 2014

0.1.4

0.1.4.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

03/03 2014

0.1.3

0.1.3.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

03/03 2014

0.1.2

0.1.2.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

02/03 2014

0.1.1

0.1.1.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal

02/03 2014

0.1.0

0.1.0.0

Temporal frequency library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar smhg

date time cron frequency temporal