wmcmahan / react-native-calendar-events

📆 React Native Module for iOS and Android Calendar Events
MIT License
906 stars 292 forks source link

Error: No end date has been set #344

Open tatva-hiral opened 3 years ago

tatva-hiral commented 3 years ago

Getting below error in ios when I am not passing endDate

Possible Unhandled Promise Rejection (id: 1):
Error: No end date has been set.
Error: No end date has been set.
    at Object.fn [as saveEvent] (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3569:36)
    at Object.saveEvent (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:287238:31)
    at createAndStoreEvents$ (http://localhost:8081/app/modules/calendar/calendarUtils.bundle?platform=ios&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true:602:82)
    at tryCatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2021:19)
    at Generator.invoke [as _invoke] (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2194:24)
    at Generator.next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2064:23)
    at tryCatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2021:19)
    at invoke (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2094:22)
    at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2124:13
    at tryCallTwo (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:4681:7)

Environment

System: OS: Windows 10 10.0.21296 CPU: (4) ia32 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Memory: 4.99 GB / 11.82 GB Binaries: Node: 10.16.0 - C:\Program Files (x86)\nodejs\node.EXE Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.9.0 - C:\Program Files (x86)\nodejs\npm.CMD npmPackages: react: 16.12.0 => 16.12.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1 react-native-screens: 2.11.0

Expected Behavior

I want to show only the start date in the ios native calendar if the end date is blank like an android.

Actual Behavior

We don't want to add endDate because event-type is (recommendations, photos, events), In android, it's working fine, it's not showing end date on google calendar.

Please help me to fix this issue. Thanks in advance.

MoOx commented 3 years ago

1) You did not respect the template, not cool 2) Since you didn't respect the template, I will need to ask you "more details" because your complain clearly miss of information (code used, expected behaviour, etc)

What do you expect when saving an event with no end date? An event cannot be saved for an indefinite time.

tatva-hiral commented 3 years ago

@MoOx info updated.

MoOx commented 3 years ago

Could you explain me how an event can NOT have a end date? I don't see how it can be a thing. I mean in a real calendar, how would you show an event without an end? I am a heavy user of my calendar app on macOS and iOS and as soon as I created an event the event has 1h. I can set it "all day" but there is still an end date. I cannot save an event without an end date. And I don't see how this could be a thing.

wmcmahan commented 3 years ago

Yes, an endDate is required for a single event. But it should be possible to avoid if setting a recurring event, using the recurrenceRule.