This library extends Number and Date with some useful getters and functions:
(1).day.ago
(2).weeks.fromNow
(3).hours.since(Date.yesterday())
(4).minutes.after(Date.now() + (1).day)
(5).weeks.fromNow.atTheEndOfDay
(7).weeks.ago.atTheBeginningOfYear
Read the code for more docs and have fun! Bonus points for patches :)
Well it is. Something to think about:
- http://perfectionkills.com/extending-built-in-native-objects-evil-or-not/
- http://www.nczonline.net/blog/2010/03/02/maintainable-javascript-dont-modify-objects-you-down-own/
- Antono Vasiljev
- Vasiliy Ermolovich
- and other...