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