var moment = require("alloy/moment");
var calendar = OS_IOS ? Ti.Calendar.defaultCalendar : Ti.Calendar.selectableCalendars[0];
var details = {
title: "Event is recorded with wrong date",
description: "one day earlier form given date",
begin: moment.unix("1415976478").toDate(), //Fri, 14 Nov 2014
end: moment.unix("1415976478").toDate(), //Fri, 14 Nov 2014
allDay: true
};
var event = calendar.createEvent(details);
if(OS_IOS){
event.save(Ti.Calendar.SPAN_THISEVENT);
}
The above code creates a event on 14th Nov on iOS and 13th Nov on Android. Seems a bug with android calendar module.
No comments