rainge
Linux & OSX | Windows |
---|---|
A one-liner to generate accurate date ranges for copyrights
Install
npm install --save rainge
Usage
Assuming the current year from Date
function is 2016:
Node
const rainge = ; ;//=> '2016' ;//=> '1999 - 2016'
Web
Or download it with npm install --save rainge
and reference it as:
About
I was tired of seeing websites in 2016 that said
© 2015
or even worse
© 2012 - 2014
Using rainge
, you can set your copyright year once and have it change dynamically year-to-year. If you made your code in 2016, rainge(2016)
will return 2016
until it is 2017, at which point rainge(2016)
will return 2016 - 2017
API
rainge(startYear)
startYear
Type: string
|| number
returns
Type: string
Related
License
MIT © Dawson Botsford
If you like this, star it. If you want to follow me, follow me.