Skip to content

Commit

Permalink
fix: add format only to calendar input and not for calendar types
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminic committed Nov 26, 2024
1 parent bbfbb56 commit 741fb6c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/calendar/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand All @@ -62,6 +58,12 @@ export interface CalendarProps {
export const Calendar: React.FC<CalendarProps>

export type CalendarInputProps = Omit<InputFieldProps, 'type' | 'value'> &
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<CalendarInputProps>

0 comments on commit 741fb6c

Please sign in to comment.