Calendar API not accepting any date

#1

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.

0 Likes

#2

Hi-

Can you post a Snack https://snack.expo.io 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.

0 Likes

#3

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
https://snack.expo.io/@sisthra/test-event-insert

0 Likes

closed #4

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

0 Likes