Date helpers in function-per-file style.
npm install --save date-fns
var isLastDayOfMonth = require('date-fns/src/is_last_day_of_month');
var date = new Date(2014, 1, 28);
console.log(isLastDayOfMonth(date));
//=> true
Code is fully documented, checkout source for reference.
format
- TODOparse
- TODOisFuture
- is passed date is future?
isWithinRange
- is passed date is within range?
isWeekend
- is passed date is weekend?isToday
- is passed date is today?startOfDay
- returns start of a day for passed dateendOfDay
- returns end of a day for passed dateaddDays
- add specified number of days to passed datesubDays
- substract specified number of days from passed dateeachDay
- returns array of dates within specified range
startOfWeek
- returns start of a week for passed dateendOfWeek
- returns end of a week for passed dateisSameWeek
- returns true if passed dates belongs to the same week
startOfMonth
- returns start of a month for passed dateendOfMonth
- returns end of a month for passed dateaddMonths
- add specified number of months to passed datesubMonths
- substract specified number of days from passed dateisSameMonth
- returns true if passed dates has same month (and year)isFirstDayOfMonth
- return true if passed date is first day of monthisLastDayOfMonth
- return true if passed date is last day of monthsetMonth
- sets month index
setYear
- sets full yearisSameYear
- is passed dates has the same year?
TODO