From ef8a08931cd86ab0fc875541161df8e250119591 Mon Sep 17 00:00:00 2001 From: Rene Fitzke Date: Tue, 5 Nov 2024 10:42:10 +0100 Subject: [PATCH 1/2] Respect disabling the format in label --- src/Date/CalendarEdit.tsx | 5 +++++ src/Date/DatePickerInput.tsx | 1 + src/Date/DatePickerModal.tsx | 1 + src/Date/DatePickerModalContent.tsx | 1 + src/Date/DatePickerModalContentHeader.tsx | 1 + 5 files changed, 9 insertions(+) diff --git a/src/Date/CalendarEdit.tsx b/src/Date/CalendarEdit.tsx index 843e9f17..ea76b2ab 100644 --- a/src/Date/CalendarEdit.tsx +++ b/src/Date/CalendarEdit.tsx @@ -24,6 +24,7 @@ function CalendarEdit({ validRange, locale, inputEnabled, + withDateFormatInLabel, }: { mode: ModeType label?: string @@ -35,6 +36,7 @@ function CalendarEdit({ validRange: ValidRangeType | undefined locale: string inputEnabled?: boolean + withDateFormatInLabel?: boolean }) { const dateInput = useRef(null) const startInput = useRef(null) @@ -93,6 +95,7 @@ function CalendarEdit({ withModal={false} autoComplete={'off'} inputEnabled={inputEnabled} + withDateFormatInLabel={withDateFormatInLabel} /> ) : null} {mode === 'range' ? ( @@ -110,6 +113,7 @@ function CalendarEdit({ withModal={false} autoComplete={'off'} inputEnabled={inputEnabled} + withDateFormatInLabel={withDateFormatInLabel} /> ) : null} diff --git a/src/Date/DatePickerInput.tsx b/src/Date/DatePickerInput.tsx index ab759cde..713e7394 100644 --- a/src/Date/DatePickerInput.tsx +++ b/src/Date/DatePickerInput.tsx @@ -87,6 +87,7 @@ function DatePickerInput( presentationStyle={presentationStyle} label={rest.label as any} startWeekOnMonday={startWeekOnMonday} + withDateFormatInLabel={rest.withDateFormatInLabel} /> ) : null } diff --git a/src/Date/DatePickerModal.tsx b/src/Date/DatePickerModal.tsx index f116e72a..212ce355 100644 --- a/src/Date/DatePickerModal.tsx +++ b/src/Date/DatePickerModal.tsx @@ -101,6 +101,7 @@ export function DatePickerModal( disableSafeTop={disableStatusBarPadding} disableStatusBar={disableStatusBar} statusBarOnTopOfBackdrop={isPageSheet || statusBarOnTopOfBackdrop} + withDateFormatInLabel={props.withDateFormatInLabel} /> diff --git a/src/Date/DatePickerModalContent.tsx b/src/Date/DatePickerModalContent.tsx index 77c79e2f..793fe7f9 100644 --- a/src/Date/DatePickerModalContent.tsx +++ b/src/Date/DatePickerModalContent.tsx @@ -212,6 +212,7 @@ export function DatePickerModalContent( validRange={validRange} locale={locale} inputEnabled={props.inputEnabled} + withDateFormatInLabel={props.withDateFormatInLabel} /> } /> diff --git a/src/Date/DatePickerModalContentHeader.tsx b/src/Date/DatePickerModalContentHeader.tsx index 406e0739..f4ab59fa 100644 --- a/src/Date/DatePickerModalContentHeader.tsx +++ b/src/Date/DatePickerModalContentHeader.tsx @@ -12,6 +12,7 @@ export interface HeaderPickProps { moreLabel?: string label?: string emptyLabel?: string + withDateFormatInLabel?: boolean saveLabel?: string uppercase?: boolean headerSeparator?: string From 241ed16678f6a65d5a4c5045c875da9e51f52720 Mon Sep 17 00:00:00 2001 From: Rene Fitzke Date: Tue, 5 Nov 2024 10:45:40 +0100 Subject: [PATCH 2/2] Pass placeholder through to edit input-field --- src/Date/CalendarEdit.tsx | 5 +++++ src/Date/DatePickerInput.tsx | 1 + src/Date/DatePickerModal.tsx | 1 + src/Date/DatePickerModalContent.tsx | 1 + src/Date/DatePickerModalContentHeader.tsx | 1 + 5 files changed, 9 insertions(+) diff --git a/src/Date/CalendarEdit.tsx b/src/Date/CalendarEdit.tsx index ea76b2ab..33d929d4 100644 --- a/src/Date/CalendarEdit.tsx +++ b/src/Date/CalendarEdit.tsx @@ -25,6 +25,7 @@ function CalendarEdit({ locale, inputEnabled, withDateFormatInLabel, + placeholder, }: { mode: ModeType label?: string @@ -37,6 +38,7 @@ function CalendarEdit({ locale: string inputEnabled?: boolean withDateFormatInLabel?: boolean + placeholder?: string }) { const dateInput = useRef(null) const startInput = useRef(null) @@ -96,6 +98,7 @@ function CalendarEdit({ autoComplete={'off'} inputEnabled={inputEnabled} withDateFormatInLabel={withDateFormatInLabel} + placeholder={placeholder} /> ) : null} {mode === 'range' ? ( @@ -114,6 +117,7 @@ function CalendarEdit({ autoComplete={'off'} inputEnabled={inputEnabled} withDateFormatInLabel={withDateFormatInLabel} + placeholder={placeholder} /> ) : null} diff --git a/src/Date/DatePickerInput.tsx b/src/Date/DatePickerInput.tsx index 713e7394..cf951ee4 100644 --- a/src/Date/DatePickerInput.tsx +++ b/src/Date/DatePickerInput.tsx @@ -88,6 +88,7 @@ function DatePickerInput( label={rest.label as any} startWeekOnMonday={startWeekOnMonday} withDateFormatInLabel={rest.withDateFormatInLabel} + placeholder={rest.placeholder} /> ) : null } diff --git a/src/Date/DatePickerModal.tsx b/src/Date/DatePickerModal.tsx index 212ce355..e8d8dc45 100644 --- a/src/Date/DatePickerModal.tsx +++ b/src/Date/DatePickerModal.tsx @@ -102,6 +102,7 @@ export function DatePickerModal( disableStatusBar={disableStatusBar} statusBarOnTopOfBackdrop={isPageSheet || statusBarOnTopOfBackdrop} withDateFormatInLabel={props.withDateFormatInLabel} + placeholder={props.placeholder} /> diff --git a/src/Date/DatePickerModalContent.tsx b/src/Date/DatePickerModalContent.tsx index 793fe7f9..04a0e4f1 100644 --- a/src/Date/DatePickerModalContent.tsx +++ b/src/Date/DatePickerModalContent.tsx @@ -213,6 +213,7 @@ export function DatePickerModalContent( locale={locale} inputEnabled={props.inputEnabled} withDateFormatInLabel={props.withDateFormatInLabel} + placeholder={props.placeholder} /> } /> diff --git a/src/Date/DatePickerModalContentHeader.tsx b/src/Date/DatePickerModalContentHeader.tsx index f4ab59fa..1d00c145 100644 --- a/src/Date/DatePickerModalContentHeader.tsx +++ b/src/Date/DatePickerModalContentHeader.tsx @@ -13,6 +13,7 @@ export interface HeaderPickProps { label?: string emptyLabel?: string withDateFormatInLabel?: boolean + placeholder?: string saveLabel?: string uppercase?: boolean headerSeparator?: string