diff --git a/apps/portal/src/app/components/AmharicDatePicker.tsx b/apps/portal/src/app/components/AmharicDatePicker.tsx index 13bade18f..2bad4c4c8 100644 --- a/apps/portal/src/app/components/AmharicDatePicker.tsx +++ b/apps/portal/src/app/components/AmharicDatePicker.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import { useTranslation } from 'react-i18next'; import { ActionIcon, Button, Group, Popover, TextInput } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { DayPicker as EthiopicDayPicker } from '@daypicker/ethiopic'; @@ -77,7 +78,10 @@ export function AmharicDatePicker({ required, placeholder, }: AmharicDatePickerProps) { - const [calendarType, setCalendarType] = useState<'EN' | 'AMH'>('AMH'); + const { i18n } = useTranslation(); + const [calendarType, setCalendarType] = useState<'EN' | 'AMH'>(() => + i18n.language?.startsWith('am') ? 'AMH' : 'EN', + ); const [opened, { close, toggle }] = useDisclosure(false); const displayValue = value