Skip to content

Commit f4335d5

Browse files
authored
Merge pull request #8844 from elstgav/patch-1
Clarify DateField types
2 parents ee1c6fd + 61e1b7c commit f4335d5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/ra-ui-materialui/src/field/DateField.spec.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('<DateField />', () => {
107107

108108
it('should pass the options prop to toLocaleString', () => {
109109
const date = new Date('2017-04-23');
110-
const options = {
110+
const options: Intl.DateTimeFormatOptions = {
111111
weekday: 'long',
112112
year: 'numeric',
113113
month: 'long',

packages/ra-ui-materialui/src/field/DateField.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export interface DateFieldProps
129129
extends PublicFieldProps,
130130
InjectedFieldProps,
131131
Omit<TypographyProps, 'textAlign'> {
132-
locales?: string | string[];
133-
options?: object;
132+
locales?: Intl.LocalesArgument;
133+
options?: Intl.DateTimeFormatOptions;
134134
showTime?: boolean;
135135
showDate?: boolean;
136136
}

0 commit comments

Comments
 (0)