question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: No start date has been set.

See original GitHub issue

Version:

React-native-calendar-events: 1.7.3

React-native: 0.59.9

Running on iOS 13.1.3

Example code used:

RNCalendarEvents.authorizeEventStore().then(() => {
            const notes = `This is the notes`;
            const calendareObject = {
              startDate: new Date(slotDateTimeInUnix),
              endDate: new Date(slotEndDateTimeInUnix),
              alarms: [{ date: -60 }]
            }
            if(Platform.OS === 'ios') {
              calendareObject.notes = notes;
            } else {
              calendareObject.description = notes;
            }
            RNCalendarEvents.saveEvent(`AppointmentName`, calendareObject)
            .then(response => {
              Alert.alert(`Saved to calendar with response: ${response}`)
            }).catch(error => {
              Alert.alert(error) // line catching the error
            });
}).catch(error => ErrorHandler.handleError(error));

The issue:

Saving events have worked in all environments for the longest, but lately it has mysteriously stopped working on iOS devices. When saving an event on iOS simulator, everything is saved as expected.

The error presented in the app installed on a device via TestFlight is:

Error: No start date has been set…

When alerting the startDate before trying to save the event it’s there and in the correct format, the same format as on the simulator. Seemingly the object being saved is the same on both the simulator and in TestFlight, but with the error being returned from the TestFlight version.

I have NSCalendarsUsageDescription set in info.plist.

Any suggestions or ideas?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
kam89commented, Jan 9, 2020

Please set the Date to ISO Format.

1reaction
bramskicommented, Oct 15, 2020

Figured it out. The start date must include microseconds: 2020-11-01T19:00:00.000Z That’s not ISO. Sorry @wmcmahan you should check what ISO format is actually defined as.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How I can fix error "No start date has been set"? - Stack Overflow
An error is displayed: "failed to save event with error: Error Domain = EKErrorDomain Code = 2" No start date has been set....
Read more >
"The Start date is invalid. Please enter a date in the format ...
Testing the new date range field, after saving the node I get the error: "The Start date is invalid. Please enter a date...
Read more >
Outlook 2010 "The end date you entered is before the start ...
If you go to File/ Options/ Calendar/ WorkTime and change Work Hours: End time: to 11:30 pm from the DEFAULT setting of 5:00pm,...
Read more >
Error in Start Date & Time: the data is in AM but the program ...
I am working on a zap to create a Google Calendar from Google Sheet. The problem is, the time that is read by...
Read more >
COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Entering work hours before they have actually been worked. Employees are not allowed to record their work time until they have actually worked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found