https://github.com/dawsbot/rainge
Make copyright's great again
https://github.com/dawsbot/rainge
Last synced: about 1 year ago
JSON representation
Make copyright's great again
- Host: GitHub
- URL: https://github.com/dawsbot/rainge
- Owner: dawsbot
- License: mit
- Created: 2016-03-16T20:07:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T23:09:08.000Z (over 8 years ago)
- Last Synced: 2024-11-03T06:10:01.016Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 52.7 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
- License: license
Awesome Lists containing this project
README
# rainge
[](https://www.npmjs.com/package/rainge)
[](http://npmjs.org/rainge)
[](https://github.com/sindresorhus/xo)
> Use date ranges that never need updating
## Install
```
npm install --save rainge
```
## Usage
#### Node
```js
const rainge = require('rainge');
// assuming the current year is 2018:
rainge(2018);
//=> '2018'
rainge(2009);
//=> '2009 - 2018'
```
#### Web
```html
alert('\u00A9 ' + rainge(1999));
//=> © 1999 - 2018
```
Or download it with `npm install --save rainge` and reference it as:
```html
```
## About
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"`
## API
### rainge(startYear)
##### startYear
Type: `string` || `number`
#### returns
Type: `string`
## Related
* [updateyourfooter.com](http://updateyourfooter.com/)
## License
MIT © [Dawson Botsford](https://dawsbot.com)