1.0.2 • Published 3 years ago

fy-quarter v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

fy-quarter

Calculates the quarter and fiscal year for a given date and fiscal year start month.

Install

npm install fy-quarter

Usage

The package takes 2 parameters, Date and quarter Start

Date

This parameter should be an ISO 8601 compliant date YYYY-MM-DD.

Quarter Start

This parameter should corrospond to the month where the first quarter begins.

MonthFY Year Start Month
Jan1
Feb2
Mar3
Apr4
May5
Jun6
Jul7
Aug8
Sep9
Oct10
Nov11
Dec12

Example

const fyQuarter = require("fy-quarter");

fyQuarter("2022-06-23", "4"); 
// { quarter: 1, fiscalYear: 2023, text: 'Q1 - FY23' }