From 7b9045c8d652169537b0865e50700ee34dfc9ebc Mon Sep 17 00:00:00 2001 From: Pete Wilson Date: Sun, 27 Apr 2025 13:55:45 -0500 Subject: [PATCH] Fix: Extend dayjs calendar plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds the missing extension for the calendar plugin in dayjs inside the datetime-picker.tsx file. Without this, calling dayjs(currentDate).calendar(calendar) results in a runtime TypeError: calendar is not a function. Extending the plugin fixes the crash, especially after Expo Prebuild or in native Dev Client setups where dayjs plugins must be manually extended. Thank you for your awesome work on this package! 🙌 --- src/datetime-picker.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/datetime-picker.tsx b/src/datetime-picker.tsx index 8deb622..44543e2 100644 --- a/src/datetime-picker.tsx +++ b/src/datetime-picker.tsx @@ -41,6 +41,9 @@ import duration from 'dayjs/plugin/duration'; import { usePrevious } from './hooks/use-previous'; import jalaliday from 'jalali-plugin-dayjs'; +import calendar from 'dayjs/plugin/calendar'; +dayjs.extend(calendar); + dayjs.extend(localeData); dayjs.extend(relativeTime); dayjs.extend(localizedFormat);