diff --git a/packages/grid/_modules_/grid/components/cell/GridEditDateCell.tsx b/packages/grid/_modules_/grid/components/cell/GridEditDateCell.tsx index fe8ac54df75a..32f72b82fe75 100644 --- a/packages/grid/_modules_/grid/components/cell/GridEditDateCell.tsx +++ b/packages/grid/_modules_/grid/components/cell/GridEditDateCell.tsx @@ -34,6 +34,7 @@ export function GridEditDateCell(props: GridRenderEditCellParams & InputBaseProp tabIndex, hasFocus, getValue, + inputProps, ...other } = props; @@ -117,6 +118,10 @@ export function GridEditDateCell(props: GridRenderEditCellParams & InputBaseProp fullWidth className={classes.root} type={isDateTime ? 'datetime-local' : 'date'} + inputProps={{ + max: isDateTime ? '9999-12-31T23:59' : '9999-12-31', + ...inputProps, + }} value={valueState.formatted} onChange={handleChange} {...other} diff --git a/packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterInputDate.tsx b/packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterInputDate.tsx index b7a609e82efa..624e10f82ef0 100644 --- a/packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterInputDate.tsx +++ b/packages/grid/_modules_/grid/components/panel/filterPanel/GridFilterInputDate.tsx @@ -11,7 +11,7 @@ export type GridFilterInputDateProps = GridFilterInputValueProps & export const SUBMIT_FILTER_DATE_STROKE_TIME = 500; function GridFilterInputDate(props: GridFilterInputDateProps) { - const { item, applyValue, type, apiRef, focusElementRef, ...other } = props; + const { item, applyValue, type, apiRef, focusElementRef, InputProps, ...other } = props; const filterTimeout = React.useRef(); const [filterValueState, setFilterValueState] = React.useState(item.value ?? ''); @@ -45,12 +45,6 @@ function GridFilterInputDate(props: GridFilterInputDateProps) { setFilterValueState(String(itemValue)); }, [item.value]); - const InputProps = { - ...(applying ? { endAdornment: } : {}), - max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31', - ...other.InputProps, - }; - return ( } : {}), + ...InputProps, + inputProps: { + max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31', + ...InputProps?.inputProps, + }, + }} {...other} - InputProps={InputProps} /> ); }