|
4 months ago | |
---|---|---|
.. | ||
_lib | 4 months ago | |
add | 4 months ago | |
addBusinessDays | 4 months ago | |
addDays | 4 months ago | |
addHours | 4 months ago | |
addISOWeekYears | 4 months ago | |
addMilliseconds | 4 months ago | |
addMinutes | 4 months ago | |
addMonths | 4 months ago | |
addQuarters | 4 months ago | |
addSeconds | 4 months ago | |
addWeeks | 4 months ago | |
addYears | 4 months ago | |
areIntervalsOverlapping | 4 months ago | |
clamp | 4 months ago | |
closestIndexTo | 4 months ago | |
closestTo | 4 months ago | |
compareAsc | 4 months ago | |
compareDesc | 4 months ago | |
constants | 4 months ago | |
daysToWeeks | 4 months ago | |
differenceInBusinessDays | 4 months ago | |
differenceInCalendarDays | 4 months ago | |
differenceInCalendarISOWeekYears | 4 months ago | |
differenceInCalendarISOWeeks | 4 months ago | |
differenceInCalendarMonths | 4 months ago | |
differenceInCalendarQuarters | 4 months ago | |
differenceInCalendarWeeks | 4 months ago | |
differenceInCalendarYears | 4 months ago | |
differenceInDays | 4 months ago | |
differenceInHours | 4 months ago | |
differenceInISOWeekYears | 4 months ago | |
differenceInMilliseconds | 4 months ago | |
differenceInMinutes | 4 months ago | |
differenceInMonths | 4 months ago | |
differenceInQuarters | 4 months ago | |
differenceInSeconds | 4 months ago | |
differenceInWeeks | 4 months ago | |
differenceInYears | 4 months ago | |
docs | 4 months ago | |
eachDayOfInterval | 4 months ago | |
eachHourOfInterval | 4 months ago | |
eachMinuteOfInterval | 4 months ago | |
eachMonthOfInterval | 4 months ago | |
eachQuarterOfInterval | 4 months ago | |
eachWeekOfInterval | 4 months ago | |
eachWeekendOfInterval | 4 months ago | |
eachWeekendOfMonth | 4 months ago | |
eachWeekendOfYear | 4 months ago | |
eachYearOfInterval | 4 months ago | |
endOfDay | 4 months ago | |
endOfDecade | 4 months ago | |
endOfHour | 4 months ago | |
endOfISOWeek | 4 months ago | |
endOfISOWeekYear | 4 months ago | |
endOfMinute | 4 months ago | |
endOfMonth | 4 months ago | |
endOfQuarter | 4 months ago | |
endOfSecond | 4 months ago | |
endOfToday | 4 months ago | |
endOfTomorrow | 4 months ago | |
endOfWeek | 4 months ago | |
endOfYear | 4 months ago | |
endOfYesterday | 4 months ago | |
esm | 4 months ago | |
format | 4 months ago | |
formatDistance | 4 months ago | |
formatDistanceStrict | 4 months ago | |
formatDistanceToNow | 4 months ago | |
formatDistanceToNowStrict | 4 months ago | |
formatDuration | 4 months ago | |
formatISO | 4 months ago | |
formatISO9075 | 4 months ago | |
formatISODuration | 4 months ago | |
formatRFC3339 | 4 months ago | |
formatRFC7231 | 4 months ago | |
formatRelative | 4 months ago | |
fp | 4 months ago | |
fromUnixTime | 4 months ago | |
getDate | 4 months ago | |
getDay | 4 months ago | |
getDayOfYear | 4 months ago | |
getDaysInMonth | 4 months ago | |
getDaysInYear | 4 months ago | |
getDecade | 4 months ago | |
getDefaultOptions | 4 months ago | |
getHours | 4 months ago | |
getISODay | 4 months ago | |
getISOWeek | 4 months ago | |
getISOWeekYear | 4 months ago | |
getISOWeeksInYear | 4 months ago | |
getMilliseconds | 4 months ago | |
getMinutes | 4 months ago | |
getMonth | 4 months ago | |
getOverlappingDaysInIntervals | 4 months ago | |
getQuarter | 4 months ago | |
getSeconds | 4 months ago | |
getTime | 4 months ago | |
getUnixTime | 4 months ago | |
getWeek | 4 months ago | |
getWeekOfMonth | 4 months ago | |
getWeekYear | 4 months ago | |
getWeeksInMonth | 4 months ago | |
getYear | 4 months ago | |
hoursToMilliseconds | 4 months ago | |
hoursToMinutes | 4 months ago | |
hoursToSeconds | 4 months ago | |
intervalToDuration | 4 months ago | |
intlFormat | 4 months ago | |
intlFormatDistance | 4 months ago | |
isAfter | 4 months ago | |
isBefore | 4 months ago | |
isDate | 4 months ago | |
isEqual | 4 months ago | |
isExists | 4 months ago | |
isFirstDayOfMonth | 4 months ago | |
isFriday | 4 months ago | |
isFuture | 4 months ago | |
isLastDayOfMonth | 4 months ago | |
isLeapYear | 4 months ago | |
isMatch | 4 months ago | |
isMonday | 4 months ago | |
isPast | 4 months ago | |
isSameDay | 4 months ago | |
isSameHour | 4 months ago | |
isSameISOWeek | 4 months ago | |
isSameISOWeekYear | 4 months ago | |
isSameMinute | 4 months ago | |
isSameMonth | 4 months ago | |
isSameQuarter | 4 months ago | |
isSameSecond | 4 months ago | |
isSameWeek | 4 months ago | |
isSameYear | 4 months ago | |
isSaturday | 4 months ago | |
isSunday | 4 months ago | |
isThisHour | 4 months ago | |
isThisISOWeek | 4 months ago | |
isThisMinute | 4 months ago | |
isThisMonth | 4 months ago | |
isThisQuarter | 4 months ago | |
isThisSecond | 4 months ago | |
isThisWeek | 4 months ago | |
isThisYear | 4 months ago | |
isThursday | 4 months ago | |
isToday | 4 months ago | |
isTomorrow | 4 months ago | |
isTuesday | 4 months ago | |
isValid | 4 months ago | |
isWednesday | 4 months ago | |
isWeekend | 4 months ago | |
isWithinInterval | 4 months ago | |
isYesterday | 4 months ago | |
lastDayOfDecade | 4 months ago | |
lastDayOfISOWeek | 4 months ago | |
lastDayOfISOWeekYear | 4 months ago | |
lastDayOfMonth | 4 months ago | |
lastDayOfQuarter | 4 months ago | |
lastDayOfWeek | 4 months ago | |
lastDayOfYear | 4 months ago | |
lightFormat | 4 months ago | |
locale | 4 months ago | |
max | 4 months ago | |
milliseconds | 4 months ago | |
millisecondsToHours | 4 months ago | |
millisecondsToMinutes | 4 months ago | |
millisecondsToSeconds | 4 months ago | |
min | 4 months ago | |
minutesToHours | 4 months ago | |
minutesToMilliseconds | 4 months ago | |
minutesToSeconds | 4 months ago | |
monthsToQuarters | 4 months ago | |
monthsToYears | 4 months ago | |
nextDay | 4 months ago | |
nextFriday | 4 months ago | |
nextMonday | 4 months ago | |
nextSaturday | 4 months ago | |
nextSunday | 4 months ago | |
nextThursday | 4 months ago | |
nextTuesday | 4 months ago | |
nextWednesday | 4 months ago | |
parse | 4 months ago | |
parseISO | 4 months ago | |
parseJSON | 4 months ago | |
previousDay | 4 months ago | |
previousFriday | 4 months ago | |
previousMonday | 4 months ago | |
previousSaturday | 4 months ago | |
previousSunday | 4 months ago | |
previousThursday | 4 months ago | |
previousTuesday | 4 months ago | |
previousWednesday | 4 months ago | |
quartersToMonths | 4 months ago | |
quartersToYears | 4 months ago | |
roundToNearestMinutes | 4 months ago | |
secondsToHours | 4 months ago | |
secondsToMilliseconds | 4 months ago | |
secondsToMinutes | 4 months ago | |
set | 4 months ago | |
setDate | 4 months ago | |
setDay | 4 months ago | |
setDayOfYear | 4 months ago | |
setDefaultOptions | 4 months ago | |
setHours | 4 months ago | |
setISODay | 4 months ago | |
setISOWeek | 4 months ago | |
setISOWeekYear | 4 months ago | |
setMilliseconds | 4 months ago | |
setMinutes | 4 months ago | |
setMonth | 4 months ago | |
setQuarter | 4 months ago | |
setSeconds | 4 months ago | |
setWeek | 4 months ago | |
setWeekYear | 4 months ago | |
setYear | 4 months ago | |
startOfDay | 4 months ago | |
startOfDecade | 4 months ago | |
startOfHour | 4 months ago | |
startOfISOWeek | 4 months ago | |
startOfISOWeekYear | 4 months ago | |
startOfMinute | 4 months ago | |
startOfMonth | 4 months ago | |
startOfQuarter | 4 months ago | |
startOfSecond | 4 months ago | |
startOfToday | 4 months ago | |
startOfTomorrow | 4 months ago | |
startOfWeek | 4 months ago | |
startOfWeekYear | 4 months ago | |
startOfYear | 4 months ago | |
startOfYesterday | 4 months ago | |
sub | 4 months ago | |
subBusinessDays | 4 months ago | |
subDays | 4 months ago | |
subHours | 4 months ago | |
subISOWeekYears | 4 months ago | |
subMilliseconds | 4 months ago | |
subMinutes | 4 months ago | |
subMonths | 4 months ago | |
subQuarters | 4 months ago | |
subSeconds | 4 months ago | |
subWeeks | 4 months ago | |
subYears | 4 months ago | |
toDate | 4 months ago | |
weeksToDays | 4 months ago | |
yearsToMonths | 4 months ago | |
yearsToQuarters | 4 months ago | |
CHANGELOG.md | 4 months ago | |
LICENSE.md | 4 months ago | |
README.md | 4 months ago | |
index.js | 4 months ago | |
index.js.flow | 4 months ago | |
package.json | 4 months ago | |
types.js | 4 months ago | |
typings.d.ts | 4 months ago |
date-fns provides the most comprehensive, yet simple and consistent toolset
for manipulating JavaScript dates in a browser & Node.js.
import { compareAsc, format } from 'date-fns'
format(new Date(2014, 1, 11), 'yyyy-MM-dd')
//=> '2014-02-11'
const dates = [
new Date(1995, 6, 2),
new Date(1987, 1, 11),
new Date(1989, 6, 10),
]
dates.sort(compareAsc)
//=> [
// Wed Feb 11 1987 00:00:00,
// Mon Jul 10 1989 00:00:00,
// Sun Jul 02 1995 00:00:00
// ]
The library is available as an npm package. To install the package run:
npm install date-fns --save
# or with yarn
yarn add date-fns
See date-fns.org for more details, API, and other docs.