From 3d8082885531fc5c97998e47373005e665ffe1ab Mon Sep 17 00:00:00 2001 From: Abdelrahman Awad Date: Sun, 16 Feb 2025 23:05:16 +0200 Subject: [PATCH] feat: auto inject the calendar direction --- packages/core/src/useCalendar/useCalendar.ts | 4 +++- packages/playground/src/App.vue | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/src/useCalendar/useCalendar.ts b/packages/core/src/useCalendar/useCalendar.ts index e0ba1fa0..a82e8936 100644 --- a/packages/core/src/useCalendar/useCalendar.ts +++ b/packages/core/src/useCalendar/useCalendar.ts @@ -115,10 +115,11 @@ export interface CalendarProps { export function useCalendar(_props: Reactivify) { const props = normalizeProps(_props, ['field', 'schema']); - const { weekInfo, locale, calendar, timeZone } = useLocale(props.locale, { + const { weekInfo, locale, calendar, timeZone, direction } = useLocale(props.locale, { calendar: () => toValue(props.calendar), timeZone: () => toValue(props.timeZone), }); + const pickerContext = inject(PickerContextKey, null); const calendarId = useUniqId(FieldTypePrefixes.Calendar); const gridId = `${calendarId}-g`; @@ -260,6 +261,7 @@ export function useCalendar(_props: Reactivify import DateField from '@/components/DateField.vue'; import Calendar from './components/Calendar.vue'; -// import { createCalendar } from '@internationalized/date'; +import { createCalendar } from '@internationalized/date'; const minDate = new Date(2025, 1, 14, 0, 0, 0, 0); const maxDate = new Date(2025, 1, 18, 0, 0, 0, 0); + +const islamic = createCalendar('islamic-umalqura');