I am trying to run this opensource project. The issue is whenever I try and use the calendar selector, it throws the following error:
TypeError: undefined is not an object (evaluating '_xdate.default.locales[_xdate.default.defaultLocale].today')
The view snippet looks like this:
<TouchableInput icon="calendar" value={checkin} label={t('common.checkInOut')} onPress={() => setModal('calendar')}/>
The setModal function looks like this:
// handleCalendarconst handleCalendar = useCallback( (calendar) => { const startDate = dayjs(calendar.start).format('YYYY-MM-DD'); const endDate = dayjs(calendar.end).format('YYYY-MM-DD'); setCheckin(`${startDate} to ${endDate}`); setCalendar(calendar); }, [setCheckin, setCalendar],);
This calendar relies on the dayjs package. Within my expo error, I see the following code snippet:
getAccessibilityLabel = memoize((day, marking, isToday) => { const today = XDate.locales[XDate.defaultLocale].today; const formatAccessibilityLabel = XDate.locales[XDate.defaultLocale].formatAccessibilityLabel; const markingLabel = this.getMarkingLabel(marking);}
I am not exactly sure what is going on and to be honest, my knowledge of xdate and dayjs is very limited. But any help would be greatly appriciated.