elegant-date
Install
npm i elegant-date
Usage
Instantiate
var now = nowdate// => Fri Apr 13 2018 18:54:32 var now = nowdate// => Mon Jan 01 2018 00:00:00
Add days
nowyesterdaydate// => Fri Apr 12 2018 18:54:32 nowtomorrowdate// => Fri Apr 14 2018 18:54:32 nowdate// => Fri Apr 16 2018 18:54:32
Add months
nowdate// => Fri Jan 13 2018 18:54:32 nowdate// => Fri Jul 13 2018 18:54:32
Add years
nowdate// => Fri Apr 13 2015 18:54:32 nowdate// => Fri Apr 13 2021 18:54:32
Go to the beginning or the end of month
nowbeginningOfMonthdate// => Fri Apr 01 2018 00:00:00 nowendOfMonthdate// => Fri Apr 30 2018 00:00:00
Support chaining
nowbeginningOfMonthtomorrowdate// => Fri Apr 02 2018 00:00:00
Formatting String
now// => 2018-04-13 18:54:32 now// => April 13, 2018 18:54:32
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/khiav223577/elegant-date. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.