DateRangePicker
DateRangePicker component is a date input with a calendar popover below.
Import
Usage
Here's a basic usage of the DateRangePicker component.
Editable Example
–
Sizes
Editable Example
–
Format
Format of the string is based on Unicode Technical Standard #35.
Editable Example
–
Without time
Editable Example
–
Disable auto focus mode
Editable Example
–
Disabled date
Editable Example
–
Don't show input
Editable Example
Props
The DateRangePicker component composes PseudoBox so you can pass all
PseudoBox
props, and React.InputHTMLAttributes
.
Name | Type | Default | Description |
---|---|---|---|
startDate | Date | required | A state to control start date of the DateRangePicker. |
setStartDate | function | required | A function that receives the updated start date, used to update your state. |
endDate | Date | required | A state to control end date of the DateRangePicker. |
setEndDate | function | required | A function that receives the updated end date, used to update your state. |
formatDate | string | The format of the display date. | |
includeTime | boolean | true | Show time in the calendar. |
autoChangeFocus | boolean | true | Auto change focus after selecting date. |
disabledDate | function | Specify the date that cannot be selected. | |
placeholder | string | The placeholder for the inner input field. | |
size | "sm" , "md" | "md" | The size of the input field and the calendar. |
placement | PopperJS.Placement | "bottom" | The placement of the calendar dropdown. |