moment/moment — pull request #1794 by triqi (2014-07-24 01:53:19+00:00)
Title: Feature/round to

Round up, down or to the nearest unit.

Usage: moment.roundTo(units, [offset, midpoint])

m.roundTo('minute', 15); // Round the moment to the nearest 15 minutes.
m.roundTo('minute', 15, 'up'); // Round the moment up to the nearest 15 minutes.
m.roundTo('minute', 15, 'down'); // Round the moment down to the nearest 15 minutes.