Skip to content

Commit 48102fd

Browse files
Fix
1 parent 4c1fe70 commit 48102fd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/data/date-pickers/custom-components/ActionBarComponent.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
99
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
1010
import { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker';
1111

12-
import { useLocaleText } from '@mui/x-date-pickers/hooks';
12+
import { usePickersTranslations } from '@mui/x-date-pickers/hooks';
1313

1414
function CustomActionBar(props) {
1515
const { onAccept, onClear, onCancel, onSetToday, actions, className } = props;
16-
const localeText = useLocaleText();
16+
const translations = usePickersTranslations();
1717
const [anchorEl, setAnchorEl] = React.useState(null);
1818
const open = Boolean(anchorEl);
1919
const id = useId();
@@ -34,7 +34,7 @@ function CustomActionBar(props) {
3434
}}
3535
key={actionType}
3636
>
37-
{localeText.clearButtonLabel}
37+
{translations.clearButtonLabel}
3838
</MenuItem>
3939
);
4040

@@ -47,7 +47,7 @@ function CustomActionBar(props) {
4747
}}
4848
key={actionType}
4949
>
50-
{localeText.cancelButtonLabel}
50+
{translations.cancelButtonLabel}
5151
</MenuItem>
5252
);
5353

@@ -60,7 +60,7 @@ function CustomActionBar(props) {
6060
}}
6161
key={actionType}
6262
>
63-
{localeText.okButtonLabel}
63+
{translations.okButtonLabel}
6464
</MenuItem>
6565
);
6666

@@ -74,7 +74,7 @@ function CustomActionBar(props) {
7474
}}
7575
key={actionType}
7676
>
77-
{localeText.todayButtonLabel}
77+
{translations.todayButtonLabel}
7878
</MenuItem>
7979
);
8080

packages/x-date-pickers/src/DateTimePicker/DateTimePickerTabs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const DateTimePickerTabs = function DateTimePickerTabs<TDate extends PickerValid
108108
sx,
109109
} = props;
110110

111-
const translations = usePickersTranslations();
111+
const translations = usePickersTranslations<TDate>();
112112
const classes = useUtilityClasses(props);
113113

114114
const handleChange = (event: React.SyntheticEvent, value: TabValue) => {

0 commit comments

Comments
 (0)