i want to change the title text of the component StaticDateTimePicker
what to replace
in the DOM he is
enter image description here
following the API documentation, I realized that I need to refer to components: Toolbar and use custom,
enter image description here
enter image description here
I found the default toolbar, (import {DateTimePickerToolbar} from "@mui/x-date-pickers";)
but I don’t know how to change this component in it
>Solution :
What you need is a Localization in Material UI to replace the text: https://mui.com/x/react-date-pickers/localization/
The key to replace is called as dateTimePickerToolbarTitle (Reference: https://github.com/mui/mui-x/blob/e4a23755d6f0516ab1ca1a7237e51db9d765343e/packages/x-date-pickers/src/locales/enUS.ts#L31)
To override your specific case:
<StaticDateTimePicker localeText={{ dateTimePickerToolbarTitle: 'Your Text Here' }} />