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

README.md

date-fns

date-fns provides the most comprehensive, yet simple and consistent toolset
for manipulating JavaScript dates in a browser & Node.js.

[📖  Documentation](https://date-fns.org/docs/Getting-Started/)   |   [🧑‍💻  JavaScript Jobs](https://jobs.date-fns.org/)

It's like Lodash for dates

  • It has 200+ functions for all occasions.
  • Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
  • Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
  • Immutable & Pure: Built using pure functions and always returns a new date instance.
  • TypeScript & Flow: Supports both Flow and TypeScript
  • I18n: Dozens of locales. Include only what you need.
  • and many more benefits

    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.


License

MIT © Sasha Koss