diff --git a/pages/date-range-picker/absolute-format-all-locales.page.tsx b/pages/date-range-picker/absolute-format-all-locales.page.tsx index fbc7fdf079..465f4c4ed6 100644 --- a/pages/date-range-picker/absolute-format-all-locales.page.tsx +++ b/pages/date-range-picker/absolute-format-all-locales.page.tsx @@ -13,6 +13,7 @@ const rtlLocales = new Set(['ar', 'he']); export default function DateRangePickerScenario() { const { props, settings, setSettings } = useDateRangePickerSettings({ rangeSelectorMode: 'absolute-only' }); + return ( props.granularity === 'month' diff --git a/src/date-range-picker/calendar/interfaces.ts b/src/date-range-picker/calendar/interfaces.ts index 2cdc14878b..dc13edc945 100644 --- a/src/date-range-picker/calendar/interfaces.ts +++ b/src/date-range-picker/calendar/interfaces.ts @@ -28,6 +28,8 @@ export type RangeCalendarI18nStrings = Pick< | 'isoMonthConstraintText' | 'slashedMonthConstraintText' | 'renderSelectedAbsoluteRangeAriaLive' + | 'datePlaceholder' + | 'timePlaceholder' >; export interface DateRangePickerCalendarProps diff --git a/src/date-range-picker/calendar/range-inputs.tsx b/src/date-range-picker/calendar/range-inputs.tsx index 6980b23e25..a492df8d3d 100644 --- a/src/date-range-picker/calendar/range-inputs.tsx +++ b/src/date-range-picker/calendar/range-inputs.tsx @@ -34,7 +34,9 @@ export default function RangeInputs({ const showTimeInput = !dateOnly && !isMonthPicker; const isIso = dateInputFormat === 'iso'; const separator = isIso ? '-' : '/'; - const dateInputPlaceholder = `YYYY${separator}MM${isMonthPicker ? '' : `${separator}DD`}`; + const defaultDateInputPlaceholder = `YYYY${separator}MM${isMonthPicker ? '' : `${separator}DD`}`; + const datePlaceholder = i18nStrings?.datePlaceholder || defaultDateInputPlaceholder; + const timePlaceholder = i18nStrings?.timePlaceholder || timeInputFormat; const i18nProvided = provideI18N(i18nStrings!, isMonthPicker, dateOnly, isIso); const i18nKey = generateI18NKey(isMonthPicker, dateOnly, isIso); const i18nFallbackKey = generateI18NFallbackKey(isMonthPicker, dateOnly); @@ -54,7 +56,7 @@ export default function RangeInputs({ className={clsx(testutilStyles['start-date-input'], isMonthPicker && testutilStyles['start-month-input'])} onChange={event => onChangeStartDate(event.detail.value)} format={dateInputFormat} - placeholder={dateInputPlaceholder} + placeholder={datePlaceholder} granularity={granularity} /> @@ -64,7 +66,7 @@ export default function RangeInputs({ value={startTime} onChange={event => onChangeStartTime(event.detail.value)} format={timeInputFormat} - placeholder={timeInputFormat} + placeholder={timePlaceholder} className={testutilStyles['start-time-input']} /> @@ -84,7 +86,7 @@ export default function RangeInputs({ className={clsx(testutilStyles['end-date-input'], isMonthPicker && testutilStyles['end-month-picker'])} onChange={event => onChangeEndDate(event.detail.value)} format={dateInputFormat} - placeholder={dateInputPlaceholder} + placeholder={datePlaceholder} granularity={granularity} /> @@ -94,7 +96,7 @@ export default function RangeInputs({ value={endTime} onChange={event => onChangeEndTime(event.detail.value)} format={timeInputFormat} - placeholder={timeInputFormat} + placeholder={timePlaceholder} className={testutilStyles['end-time-input']} /> diff --git a/src/date-range-picker/interfaces.ts b/src/date-range-picker/interfaces.ts index 3d741ef262..7a7fd05382 100644 --- a/src/date-range-picker/interfaces.ts +++ b/src/date-range-picker/interfaces.ts @@ -570,6 +570,22 @@ export namespace DateRangePickerProps { * @i18n */ previousYearAriaLabel?: string; + + /** + * Placeholder text for date inputs in absolute mode. + * Should match the expected date format (for example "YYYY-MM-DD", "JJJJ-MM-TT" for German). + * Used for both start and end date inputs. + * @i18n + */ + datePlaceholder?: string; + + /** + * Placeholder text for time inputs in absolute mode. + * Should match the expected time format (for example "hh:mm:ss", "HH:MM:SS"). + * Used for both start and end time inputs. + * @i18n + */ + timePlaceholder?: string; } export type AbsoluteFormat = DateFormat; diff --git a/src/i18n/messages/all.ar.json b/src/i18n/messages/all.ar.json index 39cfb04532..150feb47a1 100644 --- a/src/i18n/messages/all.ar.json +++ b/src/i18n/messages/all.ar.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "تحميل الخطوة التالية", "i18nStrings.submitButtonLoadingAnnouncement": "إرسال النموذج" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.de.json b/src/i18n/messages/all.de.json index 97f6e7cf7e..fd54343367 100644 --- a/src/i18n/messages/all.de.json +++ b/src/i18n/messages/all.de.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Nächster Schritt wird geladen", "i18nStrings.submitButtonLoadingAnnouncement": "Absenden des Formulars" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.en-GB.json b/src/i18n/messages/all.en-GB.json index 2ce501c795..1e1a32bbc5 100644 --- a/src/i18n/messages/all.en-GB.json +++ b/src/i18n/messages/all.en-GB.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Loading next step", "i18nStrings.submitButtonLoadingAnnouncement": "Submitting form" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.en.json b/src/i18n/messages/all.en.json index ec5d255e91..d961cef278 100644 --- a/src/i18n/messages/all.en.json +++ b/src/i18n/messages/all.en.json @@ -134,6 +134,8 @@ "i18nStrings.openCalendarAriaLabel": "{selectedDate, select, none {Choose date} other {Choose date, selected date is {selectedDate}}}" }, "date-range-picker": { + "i18nStrings.datePlaceholder": "YYYY-MM-DD", + "i18nStrings.timePlaceholder": "hh:mm:ss", "i18nStrings.relativeModeTitle": "Relative mode", "i18nStrings.absoluteModeTitle": "Absolute mode", "i18nStrings.relativeRangeSelectionHeading": "Choose a range", @@ -463,4 +465,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Loading next step", "i18nStrings.submitButtonLoadingAnnouncement": "Submitting form" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.es.json b/src/i18n/messages/all.es.json index 19639f7b56..8189507712 100644 --- a/src/i18n/messages/all.es.json +++ b/src/i18n/messages/all.es.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Cargando paso siguiente", "i18nStrings.submitButtonLoadingAnnouncement": "Formulario de envío" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.fr.json b/src/i18n/messages/all.fr.json index bd58c03fd7..777c2bc290 100644 --- a/src/i18n/messages/all.fr.json +++ b/src/i18n/messages/all.fr.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Chargement de l'étape suivante", "i18nStrings.submitButtonLoadingAnnouncement": "Soumission du formulaire" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.id.json b/src/i18n/messages/all.id.json index b7095eec87..fe1d7af5e5 100644 --- a/src/i18n/messages/all.id.json +++ b/src/i18n/messages/all.id.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Memuat langkah berikutnya", "i18nStrings.submitButtonLoadingAnnouncement": "Mengirimkan formulir" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.it.json b/src/i18n/messages/all.it.json index b51d1eadb6..9843cf7122 100644 --- a/src/i18n/messages/all.it.json +++ b/src/i18n/messages/all.it.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Caricamento della fase successiva", "i18nStrings.submitButtonLoadingAnnouncement": "Modulo di invio" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.ja.json b/src/i18n/messages/all.ja.json index 202b47605b..013d78ac48 100644 --- a/src/i18n/messages/all.ja.json +++ b/src/i18n/messages/all.ja.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "次のステップをロード中", "i18nStrings.submitButtonLoadingAnnouncement": "フォーム送信" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.ko.json b/src/i18n/messages/all.ko.json index 4d4407148b..33f907d3ab 100644 --- a/src/i18n/messages/all.ko.json +++ b/src/i18n/messages/all.ko.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "다음 단계 로드 중", "i18nStrings.submitButtonLoadingAnnouncement": "양식 제출 중" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.pt-BR.json b/src/i18n/messages/all.pt-BR.json index cc8a6c596d..dfcf56fccc 100644 --- a/src/i18n/messages/all.pt-BR.json +++ b/src/i18n/messages/all.pt-BR.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Carregando próxima etapa", "i18nStrings.submitButtonLoadingAnnouncement": "Enviando formulário" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.th.json b/src/i18n/messages/all.th.json index 247710388e..91de409140 100644 --- a/src/i18n/messages/all.th.json +++ b/src/i18n/messages/all.th.json @@ -361,4 +361,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "กำลังโหลดขั้นตอนถัดไป", "i18nStrings.submitButtonLoadingAnnouncement": "กำลังส่งแบบฟอร์ม" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.tr.json b/src/i18n/messages/all.tr.json index 1fc04ee184..6550e8f91c 100644 --- a/src/i18n/messages/all.tr.json +++ b/src/i18n/messages/all.tr.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "Sonraki adım yükleniyor", "i18nStrings.submitButtonLoadingAnnouncement": "Form gönderiliyor" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.zh-CN.json b/src/i18n/messages/all.zh-CN.json index 5876af8f57..6227a83e22 100644 --- a/src/i18n/messages/all.zh-CN.json +++ b/src/i18n/messages/all.zh-CN.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "正在加载下一步", "i18nStrings.submitButtonLoadingAnnouncement": "正在提交表单" } -} \ No newline at end of file +} diff --git a/src/i18n/messages/all.zh-TW.json b/src/i18n/messages/all.zh-TW.json index 5f54b2c92c..a94e5ed8ba 100644 --- a/src/i18n/messages/all.zh-TW.json +++ b/src/i18n/messages/all.zh-TW.json @@ -463,4 +463,4 @@ "i18nStrings.nextButtonLoadingAnnouncement": "載入下一個步驟", "i18nStrings.submitButtonLoadingAnnouncement": "提交表單" } -} \ No newline at end of file +}