@@ -22,6 +22,8 @@ import {FieldButton} from '@react-spectrum/button';
22
22
import { Flex } from '@react-spectrum/layout' ;
23
23
import { FocusableRef } from '@react-types/shared' ;
24
24
import { Input } from './Input' ;
25
+ // @ts -ignore
26
+ import intlMessages from '../intl/*.json' ;
25
27
import { mergeProps } from '@react-aria/utils' ;
26
28
import { RangeCalendar } from '@react-spectrum/calendar' ;
27
29
import React , { ReactElement , useRef } from 'react' ;
@@ -32,7 +34,7 @@ import {useDateRangePickerState} from '@react-stately/datepicker';
32
34
import { useFocusManagerRef , useFormatHelpText , useVisibleMonths } from './utils' ;
33
35
import { useFocusRing } from '@react-aria/focus' ;
34
36
import { useHover } from '@react-aria/interactions' ;
35
- import { useLocale } from '@react-aria/i18n' ;
37
+ import { useLocale , useLocalizedStringFormatter } from '@react-aria/i18n' ;
36
38
import { useProviderProps } from '@react-spectrum/provider' ;
37
39
38
40
function DateRangePicker < T extends DateValue > ( props : SpectrumDateRangePickerProps < T > , ref : FocusableRef < HTMLElement > ) {
@@ -55,6 +57,7 @@ function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProp
55
57
let { isOpen, setOpen} = state ;
56
58
let { direction} = useLocale ( ) ;
57
59
let domRef = useFocusManagerRef ( ref ) ;
60
+ let stringFormatter = useLocalizedStringFormatter ( intlMessages ) ;
58
61
59
62
let { isFocused, isFocusVisible, focusProps} = useFocusRing ( {
60
63
within : true ,
@@ -173,7 +176,7 @@ function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProp
173
176
{ showTimeField &&
174
177
< Flex gap = "size-100" marginTop = "size-100" UNSAFE_className = { classNames ( datepickerStyles , 'react-spectrum-Datepicker-timeFields' ) } >
175
178
< TimeField
176
- label = "Start time"
179
+ label = { stringFormatter . format ( 'startTime' ) }
177
180
value = { state . timeRange ?. start || null }
178
181
onChange = { v => state . setTime ( 'start' , v ) }
179
182
placeholderValue = { timePlaceholder }
@@ -184,7 +187,7 @@ function DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProp
184
187
hideTimeZone = { props . hideTimeZone }
185
188
flex />
186
189
< TimeField
187
- label = "End time"
190
+ label = { stringFormatter . format ( 'endTime' ) }
188
191
value = { state . timeRange ?. end || null }
189
192
onChange = { v => state . setTime ( 'end' , v ) }
190
193
placeholderValue = { timePlaceholder }
0 commit comments