1.0.0 • Published 10 years ago
get-decade v1.0.0
get-decade
Get the decade from a date
Install
$ npm install --save get-decadeUsage
var getDecade = require('get-decade')
getDecade('1980-12-15')
// 80s
getDecade(new Date('1995-12-15'))
// 90sThis is a fairly low-level module and is subject to the silliness that is the JavaScript Date object.
API
getDecade(date)
Returns the decade of the given date.
date
Type: Date or string
A Date object or string that can be converted into one.
License
MIT © Juan Soto
1.0.0
10 years ago