Type Alias: DateLib
DateLib: {
addDays
: typeofaddDays
;addMonths
: typeofaddMonths
;addWeeks
: typeofaddWeeks
;addYears
: typeofaddYears
;Date
:DateConstructor
;differenceInCalendarDays
: typeofdifferenceInCalendarDays
;differenceInCalendarMonths
: typeofdifferenceInCalendarMonths
;endOfISOWeek
: typeofendOfISOWeek
;endOfMonth
: typeofendOfMonth
;endOfWeek
: typeofendOfWeek
;endOfYear
: typeofendOfYear
;format
: typeofformat
;getISOWeek
: typeofgetISOWeek
;getWeek
: typeofgetWeek
;isAfter
: typeofisAfter
;isBefore
: typeofisBefore
;isDate
: typeofisDate
;isSameDay
: typeofisSameDay
;isSameMonth
: typeofisSameMonth
;isSameYear
: typeofisSameYear
;max
: typeofmax
;min
: typeofmin
;setMonth
: typeofsetMonth
;setYear
: typeofsetYear
;startOfDay
: typeofstartOfDay
;startOfISOWeek
: typeofstartOfISOWeek
;startOfMonth
: typeofstartOfMonth
;startOfWeek
: typeofstartOfWeek
;startOfYear
: typeofstartOfYear
; }
The date library used by DayPicker. It's a subset of the date-fns functions plus an optional Date constructor.
Override the default date library with the dateLib
prop.
Type declaration​
Name | Type | Description |
---|---|---|
addDays | typeof addDays | Adds the specified number of days to the given date. |
addMonths | typeof addMonths | Adds the specified number of months to the given date. |
addWeeks | typeof addWeeks | Adds the specified number of weeks to the given date. |
addYears | typeof addYears | Adds the specified number of years to the given date. |
Date ? | DateConstructor | The constructor of the date object. |
differenceInCalendarDays | typeof differenceInCalendarDays | Returns the number of calendar days between the given dates. |
differenceInCalendarMonths | typeof differenceInCalendarMonths | Returns the number of calendar months between the given dates. |
endOfISOWeek | typeof endOfISOWeek | Returns the end of an ISO week for the given date. |
endOfMonth | typeof endOfMonth | Returns the end of the month for the given date. |
endOfWeek | typeof endOfWeek | Returns the end of the week for the given date. |
endOfYear | typeof endOfYear | Returns the end of the year for the given date. |
format | typeof format | Formats the given date using the specified format string. |
getISOWeek | typeof getISOWeek | Returns the ISO week number for the given date. |
getWeek | typeof getWeek | Returns the week number for the given date. |
isAfter | typeof isAfter | Checks if the first date is after the second date. |
isBefore | typeof isBefore | Checks if the first date is before the second date. |
isDate | typeof isDate | Checks if the given value is a date. |
isSameDay | typeof isSameDay | Checks if the given dates are the same day. |
isSameMonth | typeof isSameMonth | Checks if the given dates are in the same month. |
isSameYear | typeof isSameYear | Checks if the given dates are in the same year. |
max | typeof max | Returns the maximum of the given dates. |
min | typeof min | Returns the minimum of the given dates. |
setMonth | typeof setMonth | Sets the month for the given date. |
setYear | typeof setYear | Sets the year for the given date. |
startOfDay | typeof startOfDay | Returns the start of the day for the given date. |
startOfISOWeek | typeof startOfISOWeek | Returns the start of an ISO week for the given date. |
startOfMonth | typeof startOfMonth | Returns the start of the month for the given date. |
startOfWeek | typeof startOfWeek | Returns the start of the week for the given date. |
startOfYear | typeof startOfYear | Returns the start of the year for the given date. |