fiscal-fns
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Fiscal-fns

Build Status Coverage Status

Fiscal-fns is a date-fns like package that provides functions for working with fiscal years.

Install

npm install --save fiscal-fns

Usage

Options

All functions take an options object which looks like this:

{
  startMonth: 3, // The month your fiscal year starts in. Be aware this is 0-indexed so 0 = january 11 = decemeber.
  startDay: 1 // The date in the month your year starts on.
}

endOfFiscalYear

Parameter Default Description
date - The date to test, can be either a string or a Date. It is passed to date-fns internally so anything date-fns can parse can be used here.
options {startDay: 1, startMonth: 3} See Options above.

fiscalYear

Parameter Default Description
year - The year to return the start/end of. 2018 will return 1st April 2018 for the start and 31st March 2019 for the end.
options {startDay: 1, startMonth: 3} See Options above.

inFiscalYear

Parameter Default Description
date - The date to test, can be either a string or a Date. It is passed to date-fns internally so anything date-fns can parse can be used here.
startDate - The start of the fiscal year to test.
options {startDay: 1, startMonth: 3} See Options above.

startOfFiscalYear

Parameter Default Description
date - The date to test, can be either a string or a Date. It is passed to date-fns internally so anything date-fns can parse can be used here.
options {startDay: 1, startMonth: 3} See Options above.

Package Sidebar

Install

npm i fiscal-fns

Weekly Downloads

2,091

Version

0.0.2

License

MIT

Unpacked Size

10.5 kB

Total Files

22

Last publish

Collaborators

  • arcath