import { DateTimePickerDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx'; export default Layout(MDX_DATA.DateTimePicker); ## DatePicker props `DateTimePicker` supports most of the [DatePicker](/dates/date-picker/) props. Read through the [DatePicker](/dates/date-picker/) documentation to learn about all component features that are not listed on this page. ## Usage ## Range Set `type="range"` to allow selecting a date and time range. In range mode, two time inputs are rendered for start and end times, and a range summary is displayed below: ## With seconds ## Presets Use the `presets` prop to add custom date presets. Presets are displayed next to the calendar: ## TimePicker props You can pass props down to the underlying [TimePicker](/dates/time-picker/) component with the `timePickerProps` prop. Example of enabling dropdown and setting `12h` format for the time picker: ## Value format Use the `valueFormat` prop to change the [dayjs format](https://day.js.org/docs/en/display/format) of the value label: `valueFormat` also accepts a function that receives the value as a `YYYY-MM-DD HH:mm:ss` string and returns a custom formatted value. Use it when the formatting logic cannot be expressed with a dayjs format string: ## Disabled state ## Input props ## Clearable Set the `clearable` prop to display a clear button in the right section. Note that if you set the `rightSection` prop, the clear button will not be displayed. ## Open picker in modal By default, the picker is rendered inside [Popover](/core/popover/). You can change that to [Modal](/core/modal/) by setting `dropdownType="modal"`: ## Native level select