https://github.com/alanclarke/now-plus
Tiny date lib for getting relative dates
https://github.com/alanclarke/now-plus
ceh cmh implement
Last synced: 10 months ago
JSON representation
Tiny date lib for getting relative dates
- Host: GitHub
- URL: https://github.com/alanclarke/now-plus
- Owner: alanclarke
- Created: 2016-06-28T09:02:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T07:48:50.000Z (almost 3 years ago)
- Last Synced: 2025-03-19T21:50:43.173Z (11 months ago)
- Topics: ceh, cmh, implement
- Language: JavaScript
- Size: 2.25 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Now plus
simple lib for computing relative dates
## usage
```js
now() // new Date()
now.plus(1, 'week') // new date set to exactly now plus 1 week
now.get(myDate).plus(1, 'second') // new date set to exactly myDate plus 1 second
now.minus(2, 'days') // new date set to exactly now minus 2 days
now.get(myDate).minus(2, 'minutes') // new date set to exactly myDate minus 2 minutes
// supports seconds, minutes, hours, days, weeks and years
```
## run tests
```js
npm test
```
## Want to work on this for your day job?
This project was created by the Engineering team at Qubit. As we use open source libraries, we make our projects public where possible.
We’re currently looking to grow our team, so if you’re a JavaScript engineer and keen on ES2016 React+Redux applications and Node micro services, why not get in touch? Work with like minded engineers in an environment that has fantastic perks, including an annual ski trip, yoga, a competitive foosball league, and copious amounts of yogurt.
Find more details on our Engineering site. Don’t have an up to date CV? Just link us your Github profile! Better yet, send us a pull request that improves this project.`
Contact GitHub API Training Shop Blog About