From 86696d1c6f722cb1c3c60c9f32f083ddbe3d9044 Mon Sep 17 00:00:00 2001 From: estifanos Date: Tue, 28 Jul 2026 07:52:24 +0000 Subject: [PATCH] date picker --- apps/portal/src/app/components/AmharicDatePicker.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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