منتقي نطاق التاريخ

DateRangePicker

منتقي نطاق تاريخ متاح الوصول في React لتاريخي البداية والنهاية على تقويم واحد، مع إعدادات جاهزة وعرضين هجري وميلادي وحدود. يشارك DatePicker نواته.

يحدد DateRangePicker مدى { start, end } ويظلل الأيام بينهما. ويتشارك مع DatePicker التبديل الميلادي/الهجري ونواة التقويم نفسها.

متى تستخدمه

استخدم DateRangePicker لفترات التقارير وطلبات الإجازة ونوافذ الحجز وأي مرشّح ببداية ونهاية. وفّر إعدادات جاهزة مثل «آخر 30 يومًا» للنطاقات الشائعة. إن كفى تاريخ واحد فاستخدم DatePicker.

يتشارك المنتقيان زر التبديل الهجري، فيعمل النطاق نفسه مع تقويم أم القرى.

أمثلة

أساسي

إعدادات جاهزة (وصفة تركيب)

التقويم الهجري

الخصائص

الخصائص التي يعرّفها DateRangePicker. سمات العنصر الأصلي تمرّ كما هي.

الخاصيةالنوعالافتراضيالوصف
size"md" | "lg"
variant"default" | "filled-lighter" | "filled-darker"
valueDateRangeCurrently selected range (controlled). null clears it.
defaultValueDateRangeInitial range when uncontrolled.
onChange(value: DateRange | null) => voidFires when a complete range is picked, or null when cleared.
minValueDateEarliest pickable date (inclusive).
maxValueDateLatest pickable date (inclusive).
labelreact.ReactNodeVisible label above the trigger.
helperTextreact.ReactNodeHint shown below the trigger. Hidden while an error message is showing.
errorMessagereact.ReactNodeMessage shown below the trigger when error is true.
errorbooleanMarks the field invalid - sets aria-invalid and error styling.
requiredbooleanMarks the field required - adds the asterisk + aria-required.
disabledbooleanDisables the trigger entirely.
readOnlybooleanRead-only: value is shown but not editable (segments + calendar locked).
idstringCaller-supplied id for the field.
classNamestringForwarded to the Group (the trigger row), matching Input/Select.
aria-labelstring
aria-labelledbystring
calendarCalendarSystemCalendar system (controlled). Omit to let the user toggle freely.
defaultCalendarCalendarSystemInitial calendar system when uncontrolled. Defaults to 'gregorian'.
onCalendarChange(calendar: CalendarSystem) => voidFires whenever the calendar system toggles.
showCalendarTogglebooleanShow the Gregorian↔Hijri toggle inside the popover. Defaults to true, but is forced off when calendar is controlled.
calendarLabelsCalendarLabelsOverride the toggle labels. Defaults are locale-aware (English / Arabic).
showSecondaryCalendarbooleanWhen true, each day cell also shows the other calendar's day number as small secondary text. Helps cross-reference Hijri↔Gregorian. Default false.

إمكانية الوصول

يستخدم تقويم النطاق نموذج لوحة المفاتيح نفسه في DatePicker: مفاتيح الأسهم تتحرّك، وPage Up وPage Down يغيّران الأشهر، وEnter يختار البداية ثم النهاية. يُعلن المدى المحدّد.

تتّبع تسمية الحقل والنص المساعد والخطأ ربط TextInput. الإعدادات الجاهزة أزرار عادية، فيصل إليها مستخدم لوحة المفاتيح.