moment-round
This is a plugin for moment.js and will round date/time to a given interval.
Examples
var m = ; // 2015-06-18 15:30:19moment; // 2015-06-18 15:30:20moment; // 2015-06-18 15:33:00moment; // 2015-06-18 00:00:00moment; // 2015-06-18 21:00:00moment; // 2015-06-19 00:00:00
Possible values to round to are hours
, minutes
, seconds
Installation
Browser
Node /NPM
npm install moment-round --save-dev
And then require
it:
var moment = ;;
Bower
bower install moment-round
Running tests
gulp test
License
moment-round is LICENSED.