{ "id": "140946", "key": "AC-1484", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-07-08T15:47:59.000+0000", "created": "2014-12-04T08:04:43.000+0000", "labels": [ "TCSupportTriage", "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "updated": "2016-03-08T07:37:55.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Line 204: in EventProxy.java (https://github.com/appcelerator/titanium_mobile/blob/58198c641d77e17d156431666e80bae732b5c130/android/modules/calendar/src/java/ti/modules/titanium/calendar/EventProxy.java#L204)\r\n\r\n{code}\r\neventValues.put(Events.EVENT_TIMEZONE, new Date().toString());\r\n{code}\r\n\r\nAppears to be incorrect. The JavaScript method toString on a Date object will produce an output like so \"Thu Dec 04 2014 08:47:02 GMT+0100 (CET)\" while the Java string Events.EVENT_TIMEZONE needs to be in the format of \"GMT +01:00\" (http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html)\r\n\r\nThe result is the following code will not work correctly. The event is added incorrectly which is however only visible in certain Calendars such as the s-planner. The device is set to CET. (See screenshots)\r\n\r\nh4. Test Code\r\n{code}\r\nvar w = Titanium.UI.createWindow({backgroundColor:'#000'});\r\n \r\nvar view = Titanium.UI.createView({});\r\n \r\nvar button = Titanium.UI.createButton({\r\n height: 100,\r\n width: 300,\r\n top: '20%',\r\n title: 'add event'\r\n});\r\n\r\n// events\r\nvar events = [\r\n\t{\r\n\t\ttitle: \"Event has ümlääüts\",\r\n\t\tdescription: \"Event 1 stuff müröälad\",\r\n\t\tstart: new Date(2014, 12, 4, 17, 0, 0),\r\n\t\tend: new Date(2014, 12, 4, 18, 0, 0),\r\n\t\tallday: false\r\n\t}\r\n];\r\n\r\n\r\nfunction addEvent(data) {\r\n\r\n var calendar;\r\n\r\n\tif (Ti.Platform.osname === 'android') {\r\n\t\tcalendar = Ti.Calendar.getCalendarById(1);\r\n\t} else {\r\n\t\tcalendar = Ti.Calendar.defaultCalendar;\r\n\t}\r\n\r\n console.log('start: '+data.start);\r\n console.log('end: '+data.end);\r\n\r\n\t// Create the event\t\r\n\tvar details = {\r\n\t title: data.title,\r\n\t description: data.description,\r\n\t begin: data.start,\r\n\t end: data.end,\r\n\t allDay: data.allday\r\n\t};\r\n\t\r\n\tvar event = calendar.createEvent(details);\t\r\n\t\r\n\tif (Ti.Platform.osname === 'iphone') {\r\n\t\tevent.save(Ti.Calendar.SPAN_THISEVENT);\r\n\t}\r\n}\r\n\r\nfunction addEvents(events) {\r\n\tfor(var i in events) {\r\n\t\taddEvent(events[i]);\r\n\t}\t\r\n} \r\n \r\nbutton.addEventListener('click',function(e)\r\n{\r\n\tif (Ti.Platform.osname === 'android') {\r\n\t\taddEvents(events);\r\n\t} else {\r\n\t\tif(Ti.Calendar.eventsAuthorization == Ti.Calendar.AUTHORIZATION_AUTHORIZED) {\r\n\t\t\taddEvents(events);\r\n\t\t} else {\r\n\t\t Ti.Calendar.requestEventsAuthorization(function(e){\r\n\t\t\t\taddEvents(events);\r\n\t\t });\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n});\r\n \r\nview.add(button);\r\nw.add(view);\r\nw.open();\r\n{code}", "attachment": [ { "id": "53007", "filename": "Screenshot_2014-12-04-08-58-29.png", "author": { "name": "sschueller", "key": "sschueller", "displayName": "Stefan Schüller", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-12-04T08:04:43.000+0000", "size": 338012, "mimeType": "image/png" }, { "id": "53008", "filename": "Screenshot_2014-12-04-08-59-01.png", "author": { "name": "sschueller", "key": "sschueller", "displayName": "Stefan Schüller", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-12-04T08:04:43.000+0000", "size": 114264, "mimeType": "image/png" }, { "id": "53009", "filename": "Screenshot_2014-12-04-09-02-13.png", "author": { "name": "sschueller", "key": "sschueller", "displayName": "Stefan Schüller", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-12-04T08:04:43.000+0000", "size": 70545, "mimeType": "image/png" } ], "flagged": false, "summary": "Adding Event to Android calendar has wrong timezone", "creator": { "name": "sschueller", "key": "sschueller", "displayName": "Stefan Schüller", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "sschueller", "key": "sschueller", "displayName": "Stefan Schüller", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Device1: Android 4.3 (Samsung Galaxy S3 - GT-I9300)\r\nDevice2: Android 4.4.4 (Nexus 7)\r\nTiSDK: 3.4.1.GA\r\nOSX: 10.10.1\r\n", "comment": { "comments": [], "maxResults": 2, "total": 2, "startAt": 0 } } }