You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| _lib | 5 years ago | |
| add | 5 years ago | |
| addBusinessDays | 5 years ago | |
| addDays | 5 years ago | |
| addHours | 5 years ago | |
| addISOWeekYears | 5 years ago | |
| addMilliseconds | 5 years ago | |
| addMinutes | 5 years ago | |
| addMonths | 5 years ago | |
| addQuarters | 5 years ago | |
| addSeconds | 5 years ago | |
| addWeeks | 5 years ago | |
| addYears | 5 years ago | |
| areIntervalsOverlapping | 5 years ago | |
| closestIndexTo | 5 years ago | |
| closestTo | 5 years ago | |
| compareAsc | 5 years ago | |
| compareDesc | 5 years ago | |
| constants | 5 years ago | |
| differenceInBusinessDays | 5 years ago | |
| differenceInCalendarDays | 5 years ago | |
| differenceInCalendarISOWeekYears | 5 years ago | |
| differenceInCalendarISOWeeks | 5 years ago | |
| differenceInCalendarMonths | 5 years ago | |
| differenceInCalendarQuarters | 5 years ago | |
| differenceInCalendarWeeks | 5 years ago | |
| differenceInCalendarYears | 5 years ago | |
| differenceInDays | 5 years ago | |
| differenceInHours | 5 years ago | |
| differenceInISOWeekYears | 5 years ago | |
| differenceInMilliseconds | 5 years ago | |
| differenceInMinutes | 5 years ago | |
| differenceInMonths | 5 years ago | |
| differenceInQuarters | 5 years ago | |
| differenceInSeconds | 5 years ago | |
| differenceInWeeks | 5 years ago | |
| differenceInYears | 5 years ago | |
| docs | 5 years ago | |
| eachDayOfInterval | 5 years ago | |
| eachHourOfInterval | 5 years ago | |
| eachMonthOfInterval | 5 years ago | |
| eachQuarterOfInterval | 5 years ago | |
| eachWeekOfInterval | 5 years ago | |
| eachWeekendOfInterval | 5 years ago | |
| eachWeekendOfMonth | 5 years ago | |
| eachWeekendOfYear | 5 years ago | |
| eachYearOfInterval | 5 years ago | |
| endOfDay | 5 years ago | |
| endOfDecade | 5 years ago | |
| endOfHour | 5 years ago | |
| endOfISOWeek | 5 years ago | |
| endOfISOWeekYear | 5 years ago | |
| endOfMinute | 5 years ago | |
| endOfMonth | 5 years ago | |
| endOfQuarter | 5 years ago | |
| endOfSecond | 5 years ago | |
| endOfToday | 5 years ago | |
| endOfTomorrow | 5 years ago | |
| endOfWeek | 5 years ago | |
| endOfYear | 5 years ago | |
| endOfYesterday | 5 years ago | |
| esm | 5 years ago | |
| format | 5 years ago | |
| formatDistance | 5 years ago | |
| formatDistanceStrict | 5 years ago | |
| formatDistanceToNow | 5 years ago | |
| formatDistanceToNowStrict | 5 years ago | |
| formatDuration | 5 years ago | |
| formatISO | 5 years ago | |
| formatISO9075 | 5 years ago | |
| formatISODuration | 5 years ago | |
| formatRFC3339 | 5 years ago | |
| formatRFC7231 | 5 years ago | |
| formatRelative | 5 years ago | |
| fp | 5 years ago | |
| fromUnixTime | 5 years ago | |
| getDate | 5 years ago | |
| getDay | 5 years ago | |
| getDayOfYear | 5 years ago | |
| getDaysInMonth | 5 years ago | |
| getDaysInYear | 5 years ago | |
| getDecade | 5 years ago | |
| getHours | 5 years ago | |
| getISODay | 5 years ago | |
| getISOWeek | 5 years ago | |
| getISOWeekYear | 5 years ago | |
| getISOWeeksInYear | 5 years ago | |
| getMilliseconds | 5 years ago | |
| getMinutes | 5 years ago | |
| getMonth | 5 years ago | |
| getOverlappingDaysInIntervals | 5 years ago | |
| getQuarter | 5 years ago | |
| getSeconds | 5 years ago | |
| getTime | 5 years ago | |
| getUnixTime | 5 years ago | |
| getWeek | 5 years ago | |
| getWeekOfMonth | 5 years ago | |
| getWeekYear | 5 years ago | |
| getWeeksInMonth | 5 years ago | |
| getYear | 5 years ago | |
| intervalToDuration | 5 years ago | |
| isAfter | 5 years ago | |
| isBefore | 5 years ago | |
| isDate | 5 years ago | |
| isEqual | 5 years ago | |
| isExists | 5 years ago | |
| isFirstDayOfMonth | 5 years ago | |
| isFriday | 5 years ago | |
| isFuture | 5 years ago | |
| isLastDayOfMonth | 5 years ago | |
| isLeapYear | 5 years ago | |
| isMatch | 5 years ago | |
| isMonday | 5 years ago | |
| isPast | 5 years ago | |
| isSameDay | 5 years ago | |
| isSameHour | 5 years ago | |
| isSameISOWeek | 5 years ago | |
| isSameISOWeekYear | 5 years ago | |
| isSameMinute | 5 years ago | |
| isSameMonth | 5 years ago | |
| isSameQuarter | 5 years ago | |
| isSameSecond | 5 years ago | |
| isSameWeek | 5 years ago | |
| isSameYear | 5 years ago | |
| isSaturday | 5 years ago | |
| isSunday | 5 years ago | |
| isThisHour | 5 years ago | |
| isThisISOWeek | 5 years ago | |
| isThisMinute | 5 years ago | |
| isThisMonth | 5 years ago | |
| isThisQuarter | 5 years ago | |
| isThisSecond | 5 years ago | |
| isThisWeek | 5 years ago | |
| isThisYear | 5 years ago | |
| isThursday | 5 years ago | |
| isToday | 5 years ago | |
| isTomorrow | 5 years ago | |
| isTuesday | 5 years ago | |
| isValid | 5 years ago | |
| isWednesday | 5 years ago | |
| isWeekend | 5 years ago | |
| isWithinInterval | 5 years ago | |
| isYesterday | 5 years ago | |
| lastDayOfDecade | 5 years ago | |
| lastDayOfISOWeek | 5 years ago | |
| lastDayOfISOWeekYear | 5 years ago | |
| lastDayOfMonth | 5 years ago | |
| lastDayOfQuarter | 5 years ago | |
| lastDayOfWeek | 5 years ago | |
| lastDayOfYear | 5 years ago | |
| lightFormat | 5 years ago | |
| locale | 5 years ago | |
| max | 5 years ago | |
| min | 5 years ago | |
| parse | 5 years ago | |
| parseISO | 5 years ago | |
| parseJSON | 5 years ago | |
| roundToNearestMinutes | 5 years ago | |
| set | 5 years ago | |
| setDate | 5 years ago | |
| setDay | 5 years ago | |
| setDayOfYear | 5 years ago | |
| setHours | 5 years ago | |
| setISODay | 5 years ago | |
| setISOWeek | 5 years ago | |
| setISOWeekYear | 5 years ago | |
| setMilliseconds | 5 years ago | |
| setMinutes | 5 years ago | |
| setMonth | 5 years ago | |
| setQuarter | 5 years ago | |
| setSeconds | 5 years ago | |
| setWeek | 5 years ago | |
| setWeekYear | 5 years ago | |
| setYear | 5 years ago | |
| startOfDay | 5 years ago | |
| startOfDecade | 5 years ago | |
| startOfHour | 5 years ago | |
| startOfISOWeek | 5 years ago | |
| startOfISOWeekYear | 5 years ago | |
| startOfMinute | 5 years ago | |
| startOfMonth | 5 years ago | |
| startOfQuarter | 5 years ago | |
| startOfSecond | 5 years ago | |
| startOfToday | 5 years ago | |
| startOfTomorrow | 5 years ago | |
| startOfWeek | 5 years ago | |
| startOfWeekYear | 5 years ago | |
| startOfYear | 5 years ago | |
| startOfYesterday | 5 years ago | |
| sub | 5 years ago | |
| subBusinessDays | 5 years ago | |
| subDays | 5 years ago | |
| subHours | 5 years ago | |
| subISOWeekYears | 5 years ago | |
| subMilliseconds | 5 years ago | |
| subMinutes | 5 years ago | |
| subMonths | 5 years ago | |
| subQuarters | 5 years ago | |
| subSeconds | 5 years ago | |
| subWeeks | 5 years ago | |
| subYears | 5 years ago | |
| toDate | 5 years ago | |
| CHANGELOG.md | 5 years ago | |
| LICENSE.md | 5 years ago | |
| README.md | 5 years ago | |
| index.js | 5 years ago | |
| index.js.flow | 5 years ago | |
| package.json | 5 years ago | |
| typings.d.ts | 5 years ago | |
README.md
date-fns
🔥🔥🔥 date-fns v2 is out! 🔥🔥🔥
⭐️ Upgrading from v1 to v2?
- See the changelog
- Check out @date-fns/upgrade and @date-fns/upgrade-codemod, they could help you with the upgrade!
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
date-fns is like lodash for dates. It has 180+ functions for all occasions.
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
Docs
See date-fns.org for more details, API, and other docs.
JavaScript jobs by date-fns
👋 Know someone who's looking for JavaScript devs? Recommend us a job!
✉️ Get jobs worth sharing to your email! Subscribe to the newsletter.