sunfoxcz/date-utils

Library for easier working with date intervals.

v1.1.0 2019-03-22 06:21 UTC

README

Build Status Code Coverage Scrutinizer Code Quality

Library for easier working with date intervals.

Installation

composer require sunfoxcz/date-utils

Usage

<?php

use Sunfox\DateUtils\DateTime;

$start = new DateTime('2015-01-01');
$end = new DateTime('2015-12-31');

$months = DateTime::createInterval($start, $end, 'month', 1, [
	'incomes' => [],
	'expenses' => [],
]);

foreach ($months as $k => $month) {
	echo "{$k}: " . $month->date->format('Y-m-d') . PHP_EOL;
}

For more usages Look into tests directory.