MultiInputDateTimeRangeField API
API reference docs for the React MultiInputDateTimeRangeField component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro/MultiInputDateTimeRangeField';
// or
import { MultiInputDateTimeRangeField } from '@mui/x-date-pickers-pro';
Name | Type | Default | Description |
---|---|---|---|
ampm | bool | `utils.is12HourCycleInCurrentLocale()` | 12h/24h view for hour selection clock. |
autoFocus | bool | - | If |
classes | object | - | Override or extend the styles applied to the component. See CSS API below for more details. |
defaultValue | Array<object> | - | The default value. Use when the component is not controlled. |
direction | 'column-reverse' | 'column' | 'row-reverse' | 'row' | Array<'column-reverse' | 'column' | 'row-reverse' | 'row'> | object | 'column' | Defines the |
disabled | bool | false | If |
disableFuture | bool | false | If |
disableIgnoringDatePartForTimeValidation | bool | false | Do not ignore date part when validating min/max time. |
disablePast | bool | false | If |
divider | node | - | Add an element between each child. |
format | string | - | Format of the date when rendered in the input(s). |
formatDensity | 'dense' | 'spacious' | "dense" | Density of the format when rendered in the input. Setting |
maxDate | object | - | Maximal selectable date. |
maxDateTime | object | - | Maximal selectable moment of time with binding to date, to set max time in each day use |
maxTime | object | - | Maximal selectable time. The date part of the object will be ignored unless |
minDate | object | - | Minimal selectable date. |
minDateTime | object | - | Minimal selectable moment of time with binding to date, to set min time in each day use |
minTime | object | - | Minimal selectable time. The date part of the object will be ignored unless |
minutesStep | number | 1 | Step over minutes. |
onChange | func | - | Callback fired when the value changes. Signature: function(value: TValue, context: FieldChangeHandlerContext
|
onError | func | - | Callback fired when the error associated to the current value changes. Signature: function(error: TError, value: TValue) => void
|
onSelectedSectionsChange | func | - | Callback fired when the selected sections change. Signature: function(newValue: FieldSelectedSections) => void
|
readOnly | bool | false | It prevents the user from changing the value of the field (not from interacting with the field). |
referenceDate | object | The closest valid date using the validation props, except callbacks such as `shouldDisableDate`. Value is rounded to the most granular section used. | The date used to generate a part of the new value that is not present in the format when both |
selectedSections | 'all' | 'day' | 'empty' | 'hours' | 'meridiem' | 'minutes' | 'month' | 'seconds' | 'weekDay' | 'year' | number | - | The currently selected sections. This prop accepts four formats: 1. If a number is provided, the section at this index will be selected. 2. If a string of type |
shouldDisableDate | func | - | Disable specific date. Signature: function(day: TDate, position: string) => boolean
Returns: Returns |
shouldDisableTime | func | - | Disable specific time. Signature: function(value: TDate, view: TimeView) => boolean
Returns: If |
shouldRespectLeadingZeros | bool | `false` | If |
slotProps | object | {} | The props used for each component slot. |
slots | object | {} | Overridable component slots. See Slots API below for more details. |
spacing | Array<number | string> | number | object | string | 0 | Defines the space between immediate children. |
sx | Array<func | object | bool> | func | object | - | The system prop, which allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. |
timezone | string | The timezone of the `value` or `defaultValue` prop is defined, 'default' otherwise. | Choose which timezone to use for the value. Example: "default", "system", "UTC", "America/New_York". If you pass values from other timezones to some props, they will be converted to this timezone before being used. See the timezones documentation for more details. |
useFlexGap | bool | false | If |
value | Array<object> | - | The selected value. Used when the component is controlled. |
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name | Rule name | Description |
---|---|---|
.MuiMultiInputDateTimeRangeField-root | root | Styles applied to the root element. |
.MuiMultiInputDateTimeRangeField-separator | separator | Styles applied to the separator element. |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.