Linux & OSX | Windows |
---|---|
|
|
Use date ranges that never need updating
npm install --save rainge
const rainge = require('rainge');
// assuming the current year is 2018:
rainge(2018);
//=> '2018'
rainge(2009);
//=> '2009 - 2018'
<script src="https://unpkg.com/rainge/bundle.js"></script>
<script>
alert('\u00A9 ' + rainge(1999));
//=> © 1999 - 2018
</script>
Or download it with npm install --save rainge
and reference it as:
<script src="node_modules/rainge/bundle.js"></script>
I was tired of seeing websites in 2016 that said
© 2015
or even worse
© 2012 - 2014
Using rainge
, you set your copyright year once and it will automatically change year-to-year. rainge(2016)
would return "2016"
until 2017, at which point rainge(2016)
would return "2016 - 2017"
Type: string
|| number
Type: string
MIT © Dawson Botsford