Calendar API not accepting any date

I’ve been trying to use the Calendar API to insert a new event into the phone’s default calendar at the press of a button, with data from a database, but I can’t seem to get the createEventAsync to accept the data.

I’ve been using moment to get the date in the correct format (from dd-mm-yyyy to yyyy-mm-dd H:m) and then called toDate() but it still tells me that createEventAsync needs a date object.


Can you post a Snack with the code that you are trying to run?

It sounds like what you are doing is reasonable; it will be much easier to debug if you can provide concrete code.

I tryied to replicate the code in Snack but it seems to never even execute the createEvent command.
The same exact code throws the “startDate requires a Date” error in my app

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.