Hi , I am trying to create calendar event from my app. Right now trying some simple code. On button click it should add an event to device calendar. Receiving no error but at same time events are not created either. Below is my .ts code:
export class HomePage {
title = "Space Race";
eventLocation = "The Moon";
notes = "Bring Sandwiches";
startDate = new Date(2017,3,25,18,30);
endDate = new Date(2017,3,25,19,30);
constructor(public nav: NavController, public calendar: Calendar) { }
createEvent(){
this.calendar.createCalendar('MyCalendar').then(
(msg) => { console.log(msg); },
(err) => { console.log(err); }
);
this.calendar.createEvent(this.title, this.eventLocation, this.notes, this.startDate, this.endDate)
.then(() => {
console.log("Success");
},
()=>{
console.log("Fail");
})
}
}