vonovak / react-native-add-calendar-event

Create, view or edit events in react native using the standard iOS / Android dialogs
MIT License
353 stars 102 forks source link

Calendar UI is not opening on Android #65

Open vishaljadhav opened 5 years ago

vishaljadhav commented 5 years ago

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?

KorvinSzanto commented 5 years ago

~@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

yairopro commented 2 years ago

@KorvinSzanto 😍