nacholibre/billingdates

Generates start and end date for a billing cycle.

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/nacholibre/billingdates

1.0.4 2020-02-22 21:21 UTC

This package is auto-updated.

Last update: 2025-09-23 09:35:34 UTC


README

Generates start and end date for a billing cycle in PHP.

Installation

composer require nacholibre/billingdates

Example usage

<?php
use BillingDates\Calculator;

$calculator = new Calculator;

$startBillingDate = \DateTime::createFromFormat($defaultFormat, '2019-01-15');
$stubCurrentDate = \DateTime::createFromFormat($defaultFormat, '2019-03-10');

$data = $calculator->calculateMonthlyCycle($startBillingDate, $stubCurrentDate);

echo $data['start']->format('Y-m-d') . PHP_EOL;
echo $data['end']->format('Y-m-d') . PHP_EOL;

outputs

2019-02-15
2019-03-15