Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14363] Android: Calendar NOT WORKING on post-ICS included

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, core, defect
Reportergabriele
AssigneeUnknown
Created2012-10-30T09:31:17.000+0000
Updated2018-02-28T20:03:46.000+0000

Description

Hallo I'm trying to integrate the Android Calendar on ICS using SDK 2.X (I'm using the latest 2.1.3GA) with the example (Copied from the doc) code below:
var CALENDAR_TO_USE = 3;
var calendar = Ti.Android.Calendar.getCalendarById(CALENDAR_TO_USE);
 
// Create the event
var eventBegins = new Date(2010, 11, 26, 12, 0, 0);
var eventEnds = new Date(2010, 11, 26, 14, 0, 0);
var details = {
    title: 'Do some stuff',
    description: "I'm going to do some stuff at this time.",
    begin: eventBegins,
    end: eventEnds
};
 
var event = calendar.createEvent(details);
 
// Now add a reminder via e-mail for 10 minutes before the event.
var reminderDetails = {
    minutes: 10,
    method: Ti.Android.Calendar.METHOD_EMAIL
};
event.createReminder(reminderDetails);
An error is found "Event values must include an eventTimezone".

Comments

  1. gabriele 2012-10-30

    I've also post 6 months ago on a Q&A this post, but no answer were found. link: http://developer.appcelerator.com/question/137424/calendar-on-ics-error-event-values-must-include-an-eventtimezone
  2. Pedro Enrique 2013-04-05

    Hi, Sorry for the delay on this one. Have you gotten it to work since? If not, please provide some code that can be copied and pasted into app.js and run. No missing variables, etc.. thanks.
  3. gabriele 2013-04-12

    What kind of info do you need? I'm trying to add an event to an Android Calendar using your provided doc. In Titanium Modible SDK 1.X and device Android 2.X all works right but since Ti Mobile SDK 2.x and Android 3.X or 4.X no event is listed in Calendar.
  4. Daniel Sefton 2013-04-12

    We need "some code that can be copied and pasted into an app.js and run".
  5. gabriele 2013-04-18

    I've copied and pasted the same snip used by Titanium Mobile Doc. Using this code you should run an app and verify the problem.
  6. gabriele 2013-06-25

    I've spend 2 hours to make a WA for this BUG because was blocking for my App. I've insert into EventProxy.java under the method createEvent this simple 3 lines after all eventValues' properties assignment:
       public static EventProxy createEvent(CalendarProxy calendar, KrollDict data) {
          ContentResolver contentResolver = TiApplication.getInstance().getContentResolver();
          
          ...
       
          // Post ICS fix by Gabriele Ravanelli (gabriele.ravanelli@gmail.com)
          if (Build.VERSION.SDK_INT >= 11){
             // Specify your personal time zone
             eventValues.put("eventTimezone", "Europe/Rome");
          }
       
          Uri eventUri = contentResolver.insert(Uri.parse(CalendarProxy.getBaseCalendarUri()+"/events"), eventValues);
       
          ...
       
          return event;
       }
       

JSON Source