rovangju/carbon-fy

Carbon DateTime extension to determine fiscal year (FY)

1.0.0 2015-02-19 21:19 UTC

This package is auto-updated.

Last update: 2024-12-05 12:14:17 UTC


README

Build Status

Don't reinvent the wheel on that funky date logic to determine what fiscal year it is, or what fiscal year something happened in. This simple package has your back!

Overview

The ideal usage scenario would be to use a single instance of the calculator, as most organizations observe a single FY for their accounting.

Usage is pretty straight forward:

Basic usage

use CarbonExt\FiscalYear\Calculator;

$c = new Calculator(7, 1); /* FY starts on July 1 */

$c->get(new Carbon('2015-01-01')); /* 2015-06-29 */
$c->get(new Carbon('2015-07-01')); /* 2016-06-29 */