@datepicker-react/hooks
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.3.0](https://github.com/tresko/react-datepicker/compare/v2.2.0...v2.3.0) (2019-12-23) | ||
### Features | ||
* **unavailable-dates:** add unavaiable dates feature ([5039530](https://github.com/tresko/react-datepicker/commit/5039530)) | ||
# [2.2.0](https://github.com/tresko/react-datepicker/compare/v2.1.4...v2.2.0) (2019-12-06) | ||
@@ -8,0 +19,0 @@ |
@@ -24,2 +24,3 @@ import {MonthType} from './useDatepicker.utils' | ||
isDateBlocked?(date: Date): boolean | ||
unavailableDates?: Date[] | ||
} | ||
@@ -38,2 +39,3 @@ export declare function useDatepicker({ | ||
isDateBlocked: isDateBlockedProps, | ||
unavailableDates, | ||
}: UseDatepickerProps): { | ||
@@ -47,3 +49,3 @@ firstDayOfWeek: FirstDayOfWeek | ||
numberOfMonths: number | ||
isDateFocused: (date: any) => boolean | ||
isDateFocused: (date: Date) => boolean | ||
focusedDate: Date | null | ||
@@ -50,0 +52,0 @@ hoveredDate: Date | null |
@@ -0,1 +1,5 @@ | ||
export declare const isInUnavailableDates: ( | ||
unavailableDates: Date[] | undefined, | ||
date: Date, | ||
) => boolean | ||
export declare function isDateSelected( | ||
@@ -19,2 +23,3 @@ date: Date, | ||
isDateBlockedFn?: (date?: Date) => boolean | ||
unavailableDates?: Date[] | ||
} | ||
@@ -29,2 +34,3 @@ export declare function isDateBlocked({ | ||
minBookingDays, | ||
unavailableDates, | ||
}: IsDateBlockedProps): boolean | ||
@@ -31,0 +37,0 @@ export interface MonthType { |
{ | ||
"name": "@datepicker-react/hooks", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "React hooks for datepicker.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -30,60 +30,2 @@ # @datepicker-react/hooks | ||
## Table of Contents | ||
- [useDatepickerProps](#usedatepickerprops) - | ||
[onDatesChange: (data: OnDatesChangeProps) => void](#ondateschange-data-ondateschangeprops--void) - | ||
[minBookingDate: Date | undefined](#minbookingdate-date--undefined) - | ||
[maxBookingDate: Date | undefined](#maxbookingdate-date--undefined) - | ||
[startDate: Date | null](#startdate-date--null) - [endDate: Date | null](#enddate-date--null) - | ||
[focusedInput: 'startDate' | 'endDate' | null](#focusedinput-startdate--enddate--null) - | ||
[numberOfMonths: number | undefined (Default: 2)](#numberofmonths-number--undefined-default-2) - | ||
[minBookingDays: number | undefined (Default: 1)](#minbookingdays-number--undefined-default-1) - | ||
[exactMinBookingDays: boolean | undefined (Default: false)](#exactminbookingdays-boolean--undefined-default-false) - | ||
[firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6 (Default: 1 - Monday)](#firstdayofweek-0--1--2--3--4--5--6-default-1---monday) - | ||
[isDateBlocked: (date: Date) => boolean](#isdateblocked-date-date--boolean) | ||
- [useDatepickerResult](#usedatepickerresult) - | ||
[firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6](#firstdayofweek-0--1--2--3--4--5--6) - | ||
[activeMonths: ({year: number, month: number})[]](#activemonths-year-number-month-number) - | ||
[numberOfMonths: number](#numberofmonths-number) - | ||
[focusedDate: Date | null](#focuseddate-date--null) - | ||
[isDateSelected: (date: Date) => boolean](#isdateselected-date-date--boolean) - | ||
[isDateHovered: (date: Date) => boolean](#isdatehovered-date-date--boolean) - | ||
[isDateBlocked: (date: Date) => boolean](#isdateblocked-date-date--boolean-1) - | ||
[isDateFocused: (date: Date) => boolean](#isdatefocused-date-date--boolean) - | ||
[isFirstOrLastSelectedDate: (date: Date) => boolean](#isfirstorlastselecteddate-date-date--boolean) - | ||
[onResetDates: () => void](#onresetdates---void) - | ||
[onDateHover: (date: Date) => void](#ondatehover-date-date--void) - | ||
[onDateSelect: (date: Date) => void](#ondateselect-date-date--void) - | ||
[onDateFocus: (date: Date) => void](#ondatefocus-date-date--void) - | ||
[goToNextMonths: () => void](#gotonextmonths---void) - | ||
[goToPreviousMonths: () => void](#gotopreviousmonths---void) | ||
- [useMonth](#usemonth) - [useMonthProps](#usemonthprops) - [Year](#year) - [Month](#month) - | ||
[firstDayOfWeek: number | undefined (Default: 1)](#firstdayofweek-number--undefined-default-1) - | ||
[dayLabelFormat: (date: Date) => string | undefined (Default: (date: Date) => format(date, 'MMMM yyyy'))](#daylabelformat-date-date--string--undefined-default-date-date--formatdate-mmmm-yyyy) - | ||
[weekdayLabelFormat: (date: Date) => string | undefined (Default: (date: Date) => format(date, 'eeeeee'))](#weekdaylabelformat-date-date--string--undefined-default-date-date--formatdate-dd) - | ||
[monthLabelFormat: (date: Date) => string | undefined (Default: (date: Date) => format(date, 'dd'))](#monthlabelformat-date-date--string--undefined-default-date-date--formatdate-dd) - | ||
[useMonthResult](#usemonthresult) - | ||
[days: ({date: Date, dayLabel: string})[]](#days-date-date-daylabel-string) - | ||
[weekdayLabels: (string)[]](#weekdaylabels-string) - [monthLabel: string](#monthlabel-string) | ||
- [useDay](#useday) - [useDayProps](#usedayprops) - [date: Date](#date-date) - | ||
[dayRef: React.RefObject<HTMLButtonElement>](#dayref-reactrefobjecthtmlbuttonelement) - | ||
[focusedDate: Date | null](#focuseddate-date--null-1) - | ||
[isDateFocused: (date: Date) => boolean](#isdatefocused-date-date--boolean-1) - | ||
[isDateSelected: (date: Date) => boolean](#isdateselected-date-date--boolean-1) - | ||
[isDateHovered: (date: Date) => boolean](#isdatehovered-date-date--boolean-1) - | ||
[isDateBlocked: (date: Date) => boolean](#isdateblocked-date-date--boolean-2) - | ||
[isFirstOrLastSelectedDate: (date: Date) => boolean](#isfirstorlastselecteddate-date-date--boolean-1) - | ||
[onDateFocus: (date: Date) => void](#ondatefocus-date-date--void-1) - | ||
[onDateSelect: (date: Date) => void](#ondateselect-date-date--void-1) - | ||
[onDateHover: (date: Date) => void](#ondatehover-date-date--void-1) - | ||
[useDayResult](#usedayresult) - [tabIndex: 0 | -1](#tabindex-0---1) - | ||
[onKeyDown: (e: KeyboardEvent) => void](#onkeydown-e-keyboardevent--void) - | ||
[onClick: () => void](#onclick---void) - [onMouseEnter: () => void](#onmouseenter---void) - | ||
[disabledDate: boolean](#disableddate-boolean) - | ||
[isWithinHoverRange: boolean](#iswithinhoverrange-boolean) - | ||
[isSelectedStartOrEnd: boolean](#isselectedstartorend-boolean) - | ||
[isSelected: boolean](#isselected-boolean) | ||
- [Who's using](#whos-using) | ||
- [License](#license) | ||
## `useDatepicker` | ||
@@ -140,2 +82,6 @@ | ||
### `unavailableDates?: Date[]` | ||
Receives unavailable dates in array. | ||
### `useDatepickerResult` | ||
@@ -205,3 +151,3 @@ | ||
Go to the previous year by default. | ||
Go to the previous year by default. | ||
@@ -208,0 +154,0 @@ #### `goToNextYear: (numYears: number = 1) => void` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
192246
5992
277