From e93b439d50f556834751ec9ee22cf1a76f280243 Mon Sep 17 00:00:00 2001 From: Estifo77 <139631617+Estifo77@users.noreply.github.com> Date: Mon, 10 Aug 2026 12:21:40 +0300 Subject: [PATCH] date picker fix --- libs/ui/src/lib/input/AmharicDatePicker.css | 6 ++++++ libs/ui/src/lib/input/AmharicDatePicker.tsx | 3 +++ 2 files changed, 9 insertions(+) diff --git a/libs/ui/src/lib/input/AmharicDatePicker.css b/libs/ui/src/lib/input/AmharicDatePicker.css index 5520848e9..d0ee5afba 100644 --- a/libs/ui/src/lib/input/AmharicDatePicker.css +++ b/libs/ui/src/lib/input/AmharicDatePicker.css @@ -77,6 +77,8 @@ display: flex; align-items: center; height: var(--rdp-nav-height); + z-index: 10; + pointer-events: none; } .amharic-daypicker .rdp-button_previous, @@ -88,6 +90,9 @@ height: var(--rdp-nav_button-height); padding: 0; margin: 0; + position: relative; + z-index: 10; + pointer-events: auto; } .amharic-daypicker .rdp-dropdowns { @@ -154,6 +159,7 @@ .amharic-daypicker .rdp-month_caption { font-size: inherit; font-weight: 600; + margin-inline-end: calc(var(--rdp-nav_button-width) * 2 + 0.5rem); } /* Day cells are already circular (--rdp-day_button-border-radius: 100%); diff --git a/libs/ui/src/lib/input/AmharicDatePicker.tsx b/libs/ui/src/lib/input/AmharicDatePicker.tsx index e883beb73..254ee46f1 100644 --- a/libs/ui/src/lib/input/AmharicDatePicker.tsx +++ b/libs/ui/src/lib/input/AmharicDatePicker.tsx @@ -154,6 +154,7 @@ export function toGregorianDateLabel(date: Date | string): string { return d.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); } +const YEAR_DROPDOWN_START = new Date(new Date().getFullYear() - 100, 0, 1); const YEAR_DROPDOWN_END = new Date(new Date().getFullYear() + 50, 11, 31); export interface AmharicDatePickerProps { @@ -291,6 +292,7 @@ export function AmharicDatePicker({ mode="single" selected={selected ?? undefined} defaultMonth={selected ?? undefined} + startMonth={YEAR_DROPDOWN_START} endMonth={YEAR_DROPDOWN_END} numerals="latn" captionLayout="dropdown" @@ -306,6 +308,7 @@ export function AmharicDatePicker({ mode="single" selected={selected ?? undefined} defaultMonth={selected ?? undefined} + startMonth={YEAR_DROPDOWN_START} endMonth={YEAR_DROPDOWN_END} captionLayout="dropdown" onSelect={(date: Date | undefined) => {