This package has been deprecated

Author message:

This package is no longer in development

get-decade

1.0.0 • Public • Published

get-decade

Get the decade from a date

Build Status

Install

$ npm install --save get-decade

Usage

var getDecade = require('get-decade')

getDecade('1980-12-15')
// 80s
getDecade(new Date('1995-12-15'))
// 90s

This 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

Package Sidebar

Install

npm i get-decade

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • npm