From f06efe26c0ff02b37f5f65ae104797a9fd006696 Mon Sep 17 00:00:00 2001
From: hamed <15238-genius.ha@users.noreply.drupalcode.org>
Date: Sun, 2 Aug 2026 17:25:56 +0330
Subject: [PATCH] fix(holidays): honest dates and reachable fields on the
holidays page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The table had two date columns for one date: "تاریخ" printed the raw
1405-05-13 string in Latin digits, and the column labelled "میلادی" ran the
same day through formatDate — which returns Jalali. One date, twice, under a
label that lied. It is now a single formatted Jalali column.
The closure form used a native : Gregorian, an English
mm/dd/yyyy placeholder in an RTL Persian panel, and a white box in dark mode
because a native control does not follow the theme. It is the shared Persian
picker now.
That picker turned out to be a div with an onClick — no role, no tab stop, no
accessible name, and its clear button was a span. Since every page that picks
a date goes through it, it gained role/tabIndex/Enter-Space, an ariaLabel
prop, and a real button for clear. The page passes labels for the year select
and both form fields, and the global topbar search got an aria-label, which
takes the runtime accessibility probe on this page to clean.
useHolidays now returns an error, so a failed request reads as an error
instead of an empty year — previously indistinguishable.
The page had no test file; it has eight.
Co-Authored-By: Claude Opus 5
---
assets/admin/components/layout/Topbar.tsx | 2 +-
.../admin/components/ui/PersianDateInput.tsx | 2 +
.../admin/components/ui/PersianDatePicker.tsx | 27 ++++-
assets/admin/hooks/useResourceCalendar.ts | 3 +
.../admin/pages/HolidaysSettingsPage.test.tsx | 111 ++++++++++++++++++
assets/admin/pages/HolidaysSettingsPage.tsx | 83 +++++++++----
6 files changed, 200 insertions(+), 28 deletions(-)
create mode 100644 assets/admin/pages/HolidaysSettingsPage.test.tsx
diff --git a/assets/admin/components/layout/Topbar.tsx b/assets/admin/components/layout/Topbar.tsx
index bbabea39..4e2bb9c8 100644
--- a/assets/admin/components/layout/Topbar.tsx
+++ b/assets/admin/components/layout/Topbar.tsx
@@ -38,7 +38,7 @@ export default function Topbar({ onMobileMenuOpen }: { onMobileMenuOpen?: () =>
{/* Search bar — placeholder «جستجو» مطابق clinic-pro-tauri */}
-
+
diff --git a/assets/admin/components/ui/PersianDateInput.tsx b/assets/admin/components/ui/PersianDateInput.tsx
index 6116745d..d00e69fa 100644
--- a/assets/admin/components/ui/PersianDateInput.tsx
+++ b/assets/admin/components/ui/PersianDateInput.tsx
@@ -6,6 +6,8 @@ interface Props {
placeholder?: string;
/** انتخاب سال→ماه→روز را فعال میکند (مناسب تاریخ تولد). */
enableYearPicker?: boolean;
+ /** نام دسترسپذیر؛ تریگر `input` نیست پس `