2017 © Pedro Peláez
 

library cyclic-dates

A small tool library for determining the closest interval cycle to context dates

image

tworzenieweb/cyclic-dates

A small tool library for determining the closest interval cycle to context dates

  • Friday, April 15, 2016
  • by tworzenieweb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 136 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Build Status Code Climate Scrutinizer Code Quality, (*1)

Repetitive Date Estimator

Small project to help estimating events that occurs every month on specific timeframe., (*2)

So 2 weeks interval means that it should be estimated for every 15-th and 29-th day of the month Every 1 week interval means that it should be estimated for every 8-th 15-th 22-th and 29-th of the month., (*3)

Of course it is a numeric parameter so it can be even every 5 days., (*4)

The goal is to have the even occurs on exactly the same days for each month., (*5)

Example usage:

$estimator = RepetitiveDateEstimator::build(new DateTime(), RepeatitiveInterval::twoWeeks());

if today is 01.01.2016 then it would produce:, (*6)

$estimator->getNextDate(); // new DateTime('15.01.2016');
$estimator->getNextDate(); // new DateTime('29.01.2016');
$estimator->getNextDate(); // new DateTime('15.02.2016');
$estimator->getNextDate(); // new DateTime('29.02.2016');

if you want to use other intervals you can pass arbitrary number to RepetitiveInterval ValueObject, (*7)

RepetitiveInterval::oneWeek(); // every 7 days starting from the first day of month
RepetitiveInterval::fromNumber(10); // every 10 days starting from the first day of month

The Versions

15/04 2016

dev-master

9999999-dev

A small tool library for determining the closest interval cycle to context dates

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Luke Adamczewski

13/04 2016

0.0.2

0.0.2.0

A small tool library for determining the closest interval cycle to context dates

  Sources   Download

MIT

The Development Requires

by Luke Adamczewski

12/04 2016

0.0.1

0.0.1.0

A small tool library for determining the closest interval cycle to context dates

  Sources   Download

The Development Requires

by Luke Adamczewski