🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

fiscal-fns

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fiscal-fns

date-fns like functions for fiscal years

0.0.2
latest
npm
Version published
Weekly downloads
2K
-27.75%
Maintainers
1
Weekly downloads
 
Created
Source

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

ParameterDefaultDescription
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

ParameterDefaultDescription
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

ParameterDefaultDescription
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

ParameterDefaultDescription
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.

Keywords

date-fns

FAQs

Package last updated on 10 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts