0.0.3 • Published 2 years ago

@sambruca/fiscal-year v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Fiscal Year

Installation

NPM

npm install @sambruca/fiscal-year

YARN

yarn add @sambruca/fiscal-year

Usage

import { fyUtils } from "@sambruca/fiscal-year";

To fetch fiscal year of a given date:

    const date = new Date()
    const fyStartMonth = 3;
    const fiscalYear=  fyUtils.getFiscalYearOfDate(date, fyStartMonth)

fyStartMonth must always be a number from 0 to 11, 0 being Jan and 11 being December.

To build a fiscal year object, with information about the year, run:

    const fyStartMonth = 3;
    const year = 2023;
    const fiscalYear: IFiscalYear = fyUtils.buildFiscalYear(fyStartMonth, year)

The shape of the resulting object can be found here.

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago