@sambruca/fiscal-year
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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.

Package Sidebar

Install

npm i @sambruca/fiscal-year

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

10.4 kB

Total Files

11

Last publish

Collaborators

  • sambruca