0.0.1 • Published 8 years ago

date-round v0.0.1

Weekly downloads
23
License
Apache-2.0
Repository
github
Last release
8 years ago

Round/floor/ceil dates to day/week/month/year boundaries

Usage

var DateRound = require('date-round');

// Round to the nearest day
DateRound.round(Date.now());

// Midnight
DateRound.floor(Date.now());

// Next week
DateRound.ceil(Date.now(), 'week');

// Next month
DateRound.ceil(Date.now(), 'month');

// Next year
DateRound.ceil(Date.now(), 'year');
0.0.1

8 years ago