|
|
6 months ago | |
|---|---|---|
| .. | ||
| _lib | 6 months ago | |
| add | 6 months ago | |
| addBusinessDays | 6 months ago | |
| addDays | 6 months ago | |
| addHours | 6 months ago | |
| addISOWeekYears | 6 months ago | |
| addMilliseconds | 6 months ago | |
| addMinutes | 6 months ago | |
| addMonths | 6 months ago | |
| addQuarters | 6 months ago | |
| addSeconds | 6 months ago | |
| addWeeks | 6 months ago | |
| addYears | 6 months ago | |
| areIntervalsOverlapping | 6 months ago | |
| clamp | 6 months ago | |
| closestIndexTo | 6 months ago | |
| closestTo | 6 months ago | |
| compareAsc | 6 months ago | |
| compareDesc | 6 months ago | |
| constants | 6 months ago | |
| daysToWeeks | 6 months ago | |
| differenceInBusinessDays | 6 months ago | |
| differenceInCalendarDays | 6 months ago | |
| differenceInCalendarISOWeekYears | 6 months ago | |
| differenceInCalendarISOWeeks | 6 months ago | |
| differenceInCalendarMonths | 6 months ago | |
| differenceInCalendarQuarters | 6 months ago | |
| differenceInCalendarWeeks | 6 months ago | |
| differenceInCalendarYears | 6 months ago | |
| differenceInDays | 6 months ago | |
| differenceInHours | 6 months ago | |
| differenceInISOWeekYears | 6 months ago | |
| differenceInMilliseconds | 6 months ago | |
| differenceInMinutes | 6 months ago | |
| differenceInMonths | 6 months ago | |
| differenceInQuarters | 6 months ago | |
| differenceInSeconds | 6 months ago | |
| differenceInWeeks | 6 months ago | |
| differenceInYears | 6 months ago | |
| docs | 6 months ago | |
| eachDayOfInterval | 6 months ago | |
| eachHourOfInterval | 6 months ago | |
| eachMinuteOfInterval | 6 months ago | |
| eachMonthOfInterval | 6 months ago | |
| eachQuarterOfInterval | 6 months ago | |
| eachWeekOfInterval | 6 months ago | |
| eachWeekendOfInterval | 6 months ago | |
| eachWeekendOfMonth | 6 months ago | |
| eachWeekendOfYear | 6 months ago | |
| eachYearOfInterval | 6 months ago | |
| endOfDay | 6 months ago | |
| endOfDecade | 6 months ago | |
| endOfHour | 6 months ago | |
| endOfISOWeek | 6 months ago | |
| endOfISOWeekYear | 6 months ago | |
| endOfMinute | 6 months ago | |
| endOfMonth | 6 months ago | |
| endOfQuarter | 6 months ago | |
| endOfSecond | 6 months ago | |
| endOfToday | 6 months ago | |
| endOfTomorrow | 6 months ago | |
| endOfWeek | 6 months ago | |
| endOfYear | 6 months ago | |
| endOfYesterday | 6 months ago | |
| esm | 6 months ago | |
| format | 6 months ago | |
| formatDistance | 6 months ago | |
| formatDistanceStrict | 6 months ago | |
| formatDistanceToNow | 6 months ago | |
| formatDistanceToNowStrict | 6 months ago | |
| formatDuration | 6 months ago | |
| formatISO | 6 months ago | |
| formatISO9075 | 6 months ago | |
| formatISODuration | 6 months ago | |
| formatRFC3339 | 6 months ago | |
| formatRFC7231 | 6 months ago | |
| formatRelative | 6 months ago | |
| fp | 6 months ago | |
| fromUnixTime | 6 months ago | |
| getDate | 6 months ago | |
| getDay | 6 months ago | |
| getDayOfYear | 6 months ago | |
| getDaysInMonth | 6 months ago | |
| getDaysInYear | 6 months ago | |
| getDecade | 6 months ago | |
| getDefaultOptions | 6 months ago | |
| getHours | 6 months ago | |
| getISODay | 6 months ago | |
| getISOWeek | 6 months ago | |
| getISOWeekYear | 6 months ago | |
| getISOWeeksInYear | 6 months ago | |
| getMilliseconds | 6 months ago | |
| getMinutes | 6 months ago | |
| getMonth | 6 months ago | |
| getOverlappingDaysInIntervals | 6 months ago | |
| getQuarter | 6 months ago | |
| getSeconds | 6 months ago | |
| getTime | 6 months ago | |
| getUnixTime | 6 months ago | |
| getWeek | 6 months ago | |
| getWeekOfMonth | 6 months ago | |
| getWeekYear | 6 months ago | |
| getWeeksInMonth | 6 months ago | |
| getYear | 6 months ago | |
| hoursToMilliseconds | 6 months ago | |
| hoursToMinutes | 6 months ago | |
| hoursToSeconds | 6 months ago | |
| intervalToDuration | 6 months ago | |
| intlFormat | 6 months ago | |
| intlFormatDistance | 6 months ago | |
| isAfter | 6 months ago | |
| isBefore | 6 months ago | |
| isDate | 6 months ago | |
| isEqual | 6 months ago | |
| isExists | 6 months ago | |
| isFirstDayOfMonth | 6 months ago | |
| isFriday | 6 months ago | |
| isFuture | 6 months ago | |
| isLastDayOfMonth | 6 months ago | |
| isLeapYear | 6 months ago | |
| isMatch | 6 months ago | |
| isMonday | 6 months ago | |
| isPast | 6 months ago | |
| isSameDay | 6 months ago | |
| isSameHour | 6 months ago | |
| isSameISOWeek | 6 months ago | |
| isSameISOWeekYear | 6 months ago | |
| isSameMinute | 6 months ago | |
| isSameMonth | 6 months ago | |
| isSameQuarter | 6 months ago | |
| isSameSecond | 6 months ago | |
| isSameWeek | 6 months ago | |
| isSameYear | 6 months ago | |
| isSaturday | 6 months ago | |
| isSunday | 6 months ago | |
| isThisHour | 6 months ago | |
| isThisISOWeek | 6 months ago | |
| isThisMinute | 6 months ago | |
| isThisMonth | 6 months ago | |
| isThisQuarter | 6 months ago | |
| isThisSecond | 6 months ago | |
| isThisWeek | 6 months ago | |
| isThisYear | 6 months ago | |
| isThursday | 6 months ago | |
| isToday | 6 months ago | |
| isTomorrow | 6 months ago | |
| isTuesday | 6 months ago | |
| isValid | 6 months ago | |
| isWednesday | 6 months ago | |
| isWeekend | 6 months ago | |
| isWithinInterval | 6 months ago | |
| isYesterday | 6 months ago | |
| lastDayOfDecade | 6 months ago | |
| lastDayOfISOWeek | 6 months ago | |
| lastDayOfISOWeekYear | 6 months ago | |
| lastDayOfMonth | 6 months ago | |
| lastDayOfQuarter | 6 months ago | |
| lastDayOfWeek | 6 months ago | |
| lastDayOfYear | 6 months ago | |
| lightFormat | 6 months ago | |
| locale | 6 months ago | |
| max | 6 months ago | |
| milliseconds | 6 months ago | |
| millisecondsToHours | 6 months ago | |
| millisecondsToMinutes | 6 months ago | |
| millisecondsToSeconds | 6 months ago | |
| min | 6 months ago | |
| minutesToHours | 6 months ago | |
| minutesToMilliseconds | 6 months ago | |
| minutesToSeconds | 6 months ago | |
| monthsToQuarters | 6 months ago | |
| monthsToYears | 6 months ago | |
| nextDay | 6 months ago | |
| nextFriday | 6 months ago | |
| nextMonday | 6 months ago | |
| nextSaturday | 6 months ago | |
| nextSunday | 6 months ago | |
| nextThursday | 6 months ago | |
| nextTuesday | 6 months ago | |
| nextWednesday | 6 months ago | |
| parse | 6 months ago | |
| parseISO | 6 months ago | |
| parseJSON | 6 months ago | |
| previousDay | 6 months ago | |
| previousFriday | 6 months ago | |
| previousMonday | 6 months ago | |
| previousSaturday | 6 months ago | |
| previousSunday | 6 months ago | |
| previousThursday | 6 months ago | |
| previousTuesday | 6 months ago | |
| previousWednesday | 6 months ago | |
| quartersToMonths | 6 months ago | |
| quartersToYears | 6 months ago | |
| roundToNearestMinutes | 6 months ago | |
| secondsToHours | 6 months ago | |
| secondsToMilliseconds | 6 months ago | |
| secondsToMinutes | 6 months ago | |
| set | 6 months ago | |
| setDate | 6 months ago | |
| setDay | 6 months ago | |
| setDayOfYear | 6 months ago | |
| setDefaultOptions | 6 months ago | |
| setHours | 6 months ago | |
| setISODay | 6 months ago | |
| setISOWeek | 6 months ago | |
| setISOWeekYear | 6 months ago | |
| setMilliseconds | 6 months ago | |
| setMinutes | 6 months ago | |
| setMonth | 6 months ago | |
| setQuarter | 6 months ago | |
| setSeconds | 6 months ago | |
| setWeek | 6 months ago | |
| setWeekYear | 6 months ago | |
| setYear | 6 months ago | |
| startOfDay | 6 months ago | |
| startOfDecade | 6 months ago | |
| startOfHour | 6 months ago | |
| startOfISOWeek | 6 months ago | |
| startOfISOWeekYear | 6 months ago | |
| startOfMinute | 6 months ago | |
| startOfMonth | 6 months ago | |
| startOfQuarter | 6 months ago | |
| startOfSecond | 6 months ago | |
| startOfToday | 6 months ago | |
| startOfTomorrow | 6 months ago | |
| startOfWeek | 6 months ago | |
| startOfWeekYear | 6 months ago | |
| startOfYear | 6 months ago | |
| startOfYesterday | 6 months ago | |
| sub | 6 months ago | |
| subBusinessDays | 6 months ago | |
| subDays | 6 months ago | |
| subHours | 6 months ago | |
| subISOWeekYears | 6 months ago | |
| subMilliseconds | 6 months ago | |
| subMinutes | 6 months ago | |
| subMonths | 6 months ago | |
| subQuarters | 6 months ago | |
| subSeconds | 6 months ago | |
| subWeeks | 6 months ago | |
| subYears | 6 months ago | |
| toDate | 6 months ago | |
| weeksToDays | 6 months ago | |
| yearsToMonths | 6 months ago | |
| yearsToQuarters | 6 months ago | |
| CHANGELOG.md | 6 months ago | |
| LICENSE.md | 6 months ago | |
| README.md | 6 months ago | |
| index.js | 6 months ago | |
| index.js.flow | 6 months ago | |
| package.json | 6 months ago | |
| types.js | 6 months ago | |
| typings.d.ts | 6 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.