From 741fb6c84f0ce29ae6a53729cf52a3c05750f80a Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Tue, 26 Nov 2024 15:50:22 +0100 Subject: [PATCH] fix: add format only to calendar input and not for calendar types --- components/calendar/types/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/calendar/types/index.d.ts b/components/calendar/types/index.d.ts index cd9864c57..1ba2bc42e 100644 --- a/components/calendar/types/index.d.ts +++ b/components/calendar/types/index.d.ts @@ -33,10 +33,6 @@ export interface CalendarProps { * the direction of the library - internally the library will use rtl for rtl-languages but this can be overridden here for more control */ dir?: CalendarDir - /** - * the date format - */ - format?: 'YYYY-MM-DD' | 'DD-MM-YYYY' /** * any valid locale - if none provided, the internal library will fallback to the user locale (more info here: https://github.com/dhis2/multi-calendar-dates/blob/main/src/hooks/internal/useResolvedLocaleOptions.ts#L15) */ @@ -62,6 +58,12 @@ export interface CalendarProps { export const Calendar: React.FC export type CalendarInputProps = Omit & - CalendarProps + CalendarProps & { + /** + * Optional format for the date. Determines how the date is displayed + * or processed. If not provided it supports both formats + */ + format?: 'YYYY-MM-DD' | 'DD-MM-YYYY' + } export const CalendarInput: React.FC