Skip to content

Convert JS date string to day of year & vice versa 🎉

License

Notifications You must be signed in to change notification settings

hamxabaig/day-of-year

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

day-of-year Build Status

Convert js date string to day of year & vice versa 🎉

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

About

Convert JS date string to day of year & vice versa 🎉

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published