Fiscal-fns

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,
startDay: 1
}
endOfFiscalYear
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
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
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
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. |