1.0.1 • Published 5 years ago

date2doy v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

day-of-year Build Status

Convert js date string to day of year & vice versa :tada:

Install

$ npm install date2doy

Usage

const doy = require('date2doy');

doy.dateToDoy('2019-02-01');
//=> {doy: 32, year: 2019}

doy.doyToDate(2019, 32);
//=> '2019-02-01'

API

doy.dateToDoy(date)

date

Type: string

Should be along the format of: yyyy-mm-dd

doy.doyToDate(year, doy)

year

Type: number

doy

Type: number

License

MIT © Made with ❤️ & ☕️ Hamza Baig