https://github.com/deerawan/fiscal-year
Library to deal with fiscal year
https://github.com/deerawan/fiscal-year
fiscal fiscal-year tax
Last synced: 6 months ago
JSON representation
Library to deal with fiscal year
- Host: GitHub
- URL: https://github.com/deerawan/fiscal-year
- Owner: deerawan
- License: mit
- Created: 2017-04-08T11:33:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-20T10:27:16.000Z (over 9 years ago)
- Last Synced: 2025-10-04T09:18:30.888Z (10 months ago)
- Topics: fiscal, fiscal-year, tax
- Language: TypeScript
- Homepage:
- Size: 15.6 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fiscal Year 📉
[](https://travis-ci.org/deerawan/fiscal-year)
Library to deal with fiscal year.
Features:
- get fiscal year
- get fiscal month
- get fiscal quarter
## Install
```
$ npm install fiscal-year
```
## Usage
```js
const FiscalYear = require('fiscal-year');
const JUL_1 = { month: 6, day: 1 } // month is zero-based index
const inputDate = '2017-10-01';
const fiscalYear = FiscalYear(JUL_1);
fiscalYear.getFiscalYear(inputDate); // 2018
fiscalYear.getFiscalQuarter(inputDate); // 2
fiscalYear.getFiscalMonth(inputDate); // 9
```
## API
### FiscalYear(fiscalYearStart)
constructor
### getFiscalYear(date)
given a date, returns fiscal year
### getFiscalQuarter(date)
given a date, returns fiscal quarter
### getFiscalMonth(date)
given a date, returns fiscal month in zero-based month index
## License
MIT © [Budi Irawan](https://budiirawan.com)