useDatePickerCalendar

Commons
stable

Calendar computation layer for OrigamDatePicker. Derives all calendar display values (weeks, days, day metadata) from ICalendarProps in a reactive computed graph. Handles adjacent-month days, disabled states, selected ranges, week numbers and the static/dynamic weeks-in-month modes.

API

Signature

Signature TypeScript complète extraite du fichier du composable.

typescript

Interfaces consommées

ICalendarProps
IDay

API

Paramètres

Paramètres d'entrée acceptés par ce composable.

props
requis
ICalendarProps
Calendar props including date, month, year, firstDayOfWeek, weekdays, weeksInMonth, showAdjacentMonths, min, max, allowedDates and disabled.

API

Valeurs de retour

Propriétés et méthodes exposées par l'objet retourné par le composable.

displayValue
The date used as the calendar pivot. Resolves in order: displayValue prop, first selected date, min, first allowedDate, or today.
daysInMonth
Flat array of IDay objects for every visible day in the current month view, including adjacent-month days. Each entry carries isToday, isSelected, isDisabled, isAdjacent, isStart, isEnd, isWeekStart, isWeekEnd and formatted fields.
daysInWeek
IDay objects for the 7 days of the week containing displayValue. Used by the week-view variant of the picker.
genDays
Internal factory that maps raw date objects to IDay descriptors. Exposed so consumers can generate day metadata for custom views.
model
Reactive two-way model for the selected dates array (wraps the date prop via useVModel).
weeksInMonth
Array of week arrays for the current month view. In static mode, always 6 weeks.
weekDays
Visible weekday indices, shifted by firstDayOfWeek.
weekNumbers
ISO week number for each row in weeksInMonth. Null for empty rows.

Usage

Exemples

Extraits de code prêts à coller.

Render a month grid

vue