Package Exports
- date-fns/package.json
- date-fns/src/add_days
- date-fns/src/each_day
- date-fns/src/end_of_week
- date-fns/src/is_first_day_of_month
- date-fns/src/is_future
- date-fns/src/is_last_day_of_month
- date-fns/src/is_same_month
- date-fns/src/is_today
- date-fns/src/is_weekend
- date-fns/src/start_of_day
- date-fns/src/start_of_month
- date-fns/src/start_of_week
- date-fns/src/sub_days
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (date-fns) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
date-fns
Date helpers in function-per-file style.
Installation
npm install --save date-fns
Usage
var isLastDayOfMonth = require('date-fns/src/is_last_day_of_month');
var date = new Date(2014, 1, 28);
console.log(isLastDayOfMonth(date));
//=> true
API
Code is fully documented, checkout source for reference.
Common helpers
format
- TODOparse
- TODOisFuture
- is passed date is future?
Range helpers
isWithinRange
- is passed date is within range?
Day helpers
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
Week helpers
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
Month helpers
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
Year helpers
setYear
- sets full year
I18n
TODO