API Reference
Detailed documentation for the DateTimePicker component props.
DateTimePicker
The main component for selecting dates and times.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | DateTimeValue | null | null | The current value of the picker. |
| onChange | (value: DateTimeValue) => void | - | Callback fired when a date is selected. |
| timezone | string | Asia/Kolkata | IANA timezone identifier (e.g., 'America/New_York'). |
| showTime | boolean | true | Whether to show the time picker. |
| dateFormat | string | DD | Luxon date format string. |
| timeFormat | string | HH:mm | Luxon time format string. |
| minDate | Date | string | - | Minimum selectable date. |
| maxDate | Date | string | - | Maximum selectable date. |
| placeholder | string | Select... | Input placeholder text. |
| disabled | boolean | false | Disables the picker. |
| showTimezoneSelector | boolean | false | Shows a dropdown to switch timezones. |
| theme | 'light' | 'dark' | light | Color theme of the picker. |
| orientation | 'portrait' | 'landscape' | portrait | Layout orientation. |
| selectionMode | 'single' | 'range' | single | Date selection mode. |
| rangeValue | DateTimeRangeValue | null | null | The current range value (when selectionMode='range'). |
| onRangeChange | (value: DateTimeRangeValue) => void | - | Callback fired when range changes. |
| use24Hour | boolean | false | Use 24-hour format for time picker. |
| ariaLabel | string | - | ARIA label for accessibility. |
| className | string | - | Additional CSS class for the wrapper. |
DateTimeValue
The value object returned by the onChange callback.
| Property | Type | Description |
|---|---|---|
| dateTime | DateTime | The Luxon DateTime object. |
| iso | string | ISO 8601 string representation. |
| formatted | string | Formatted string based on dateFormat and timeFormat. |
| timestamp | number | Unix timestamp in milliseconds. |
DateTimeRangeValue
The value object returned by the onRangeChange callback.
| Property | Type | Description |
|---|---|---|
| start | DateTimeValue | Start date of the range. |
| end | DateTimeValue | End date of the range. |
| nights | number | Number of nights in the range. |