wix / react-native-calendars

React Native Calendar Components 🗓️ 📆
MIT License
9.52k stars 2.95k forks source link

Cannot read property 'toString' of undefined in getUTCMode #2046

Open tapz opened 2 years ago

tapz commented 2 years ago

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

WeekCalendar and ExpandableCalendar don't work. Just getting an error.

Expected Behavior

To see a calendar.

Observed Behavior

An error

If there's an error message, please paste the full terminal output and error message in this code block:

Cannot read property 'toString' of undefined

140 | proto. getUTCMode = methodize (getUTCMode);
141 | function getUTCMode(xdate){
> 142 | return date[0].toString === toUTCString;
143 | 1:

Call Stack
getUTCMode
×date.is:142:9
<anonvmous>
×date. js:186:39
getDate
new.is:74:24
getDatesArray
new.is:87:26
WeekCalendar
new.is:21:53
See 18 more frames

Environment

Please run these commands in the project folder and fill in their results:

react-native-calendars@1.1289.0 react-native@0.70.1

Also specify:

  1. Device/emulator/simulator & OS version:

Nokia X1 Android 12

Reproducible Demo

<WeekCalendar />

Screenshots

screencap

jeveloper commented 1 year ago

Same on IOS , latest version (at the time) 1.1289

Any idea what this is about?

Looks like reverting a version is needed

ziudeso commented 1 year ago

Same issue expo 46

podger commented 1 year ago

Same here with lib version: 1.1275.0 and reacat-native 0.70.4

podger commented 1 year ago

Ok basically I figured it out for my case. Just lack of documentation.

<ExpandableCelendar> and <WeekCalendar> need to be wrapped with <CalendarProvider date={'2022-10-28'} >

The undefined is from the missing date that the components try to retrieve from the context, not from the props.

Check this example out

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

JanmyLo commented 1 year ago

Ok basically I figured it out for my case. Just lack of documentation.

<ExpandableCelendar> and <WeekCalendar> need to be wrapped with <CalendarProvider date={'2022-10-28'} >

The undefined is from the missing date that the components try to retrieve from the context, not from the props.

Check this example out

this work in my case!

corgiLoaf commented 1 year ago

Ok basically I figured it out for my case. Just lack of documentation.

<ExpandableCelendar> and <WeekCalendar> need to be wrapped with <CalendarProvider date={'2022-10-28'} >

The undefined is from the missing date that the components try to retrieve from the context, not from the props.

Check this example out

You are my savior

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jeveloper commented 1 year ago

FYI it's fixed, I think I pushed a fix a while back.

Ark1011 commented 9 months ago

Ok basically I figured it out for my case. Just lack of documentation.

<ExpandableCelendar> and <WeekCalendar> need to be wrapped with <CalendarProvider date={'2022-10-28'} >

The undefined is from the missing date that the components try to retrieve from the context, not from the props.

Check this example out

this was the case

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

misaelriojasftf commented 2 days ago

it's happening again even when using the provider

image