react-native-add-calendar-event
react-native-add-calendar-event copied to clipboard
Calendar UI is not opening on Android
Below is the source code I have used in my project, functionality works as expected while in debug mode on android but once it is released nothing happens.
Source Code
var startDateNew = Moment.utc(getFormattedDate(`${this.props.start_date_timestamp}
${this.props.start_time.split(" ")[0]}`, "YYYY-MM-DDTHH:mm:ss.SSS[Z]"));
const eventConfig = {
title: this.props.title,
startDate: startDateNew
// and other options
};
Analytics.trackEvent("Start Date As per YYYY-MM-DDTHH:mm:ss.SSS[Z] " + startDateNew)
AddCalendarEvent.presentEventCreatingDialog(eventConfig)
.then((eventInfo: { calendarItemIdentifier: string, eventIdentifier: string }) => {
Analytics.trackEvent("Calender Success" + JSON.stringify(eventInfo))
})
.catch((error: string) => {
Analytics.trackEvent("Calender Error" + JSON.stringify(error))
});
Error Logged
{"line":343,"column":12139,"sourceURL":"index.android.bundle"}
What could be the problem?
~@vishaljadhav Did you ever get past this issue?~
Turns out my issue was that I was incorrectly formatting my dates. I changed my date formatting to be
moment.utc(self.startDate).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]")
and android is happy
@KorvinSzanto 😍