Skip to content

Cambrico/next_billing_date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NextBillingDate

Build StatusSoftware License

A small PHP 5.6+ library to calculate recurring billing dates.

Usage with Composer

To include it in your application using Composer, you can just include in your composer.json file:

"repositories": {
  "cambrico/next_billing_date": {
    "type": "vcs",
    "url": "https://github.com/Cambrico/next_billing_date"
  }
},
"require": {
  "cambrico/next_billing_date": "^1.0"
}

Example

<?php

// Import this library.
use Cambrico\NextBillingDate;

// Create a new DateTime object with the last billing date.
$last_billing_date = new DateTime('2019-01-30');

// Set the period, every 6 moths for this example, and calculate the next date.
$period = 6;
$next_billing_date = NextBillingDate::calculate($last_billing_date, $period)->format('Y-m-d');
// $next_billing_date will be '2019-07-30'.

$period = 1;
$next_billing_date = NextBillingDate::calculate($last_billing_date, $period)->format('Y-m-d');
// $next_billing_date will be '2019-02-28'.

About

A small PHP 5.6+ library to calculate recurring billing dates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages