{ "id": "116185", "key": "TIMOB-14286", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15547", "description": "2013 Sprint 14", "name": "2013 Sprint 14", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15548", "description": "2013 Sprint 14 API", "name": "2013 Sprint 14 API", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-03T17:23:54.000+0000", "created": "2013-06-19T16:45:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-testadded", "supportTeam" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-25T18:27:53.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6.Issue\r\nDeveloper is getting the first occurrence of the event and calling remove() on it. Although he has previously saved the event as event.save(Ti.Calendar.SPAN_FUTUREEVENTS); the future occurrences are not deleted; only the first one is. Attempt to remove the events likewise: event.remove(Ti.Calendar.SPAN_FUTUREEVENTS);\r\n\r\nh6.Steps\r\n(1) Run app and allow access to Calendar\r\n(2) Click the first button then a new ical event is added.\r\n(3) Now press the second button in order to delete this event and all the future events related to it. However only its first occurrence is successfully deleted.\r\n\r\nh6.Simple sample\r\n{code}\r\n//Creating a recurring event with alerts\r\nvar event_added; //keep track of the event you added\r\n\r\nfunction performCalendarWriteFunctions(){\r\n var defCalendar = Ti.Calendar.defaultCalendar;\r\n var date1 = new Date(new Date().getTime() + 3000),\r\n date2 = new Date(new Date().getTime() + 900000);\r\n Ti.API.info('Date1 : '+ date1 + 'Date2 : '+ date2);\r\n var event1 = defCalendar.createEvent({\r\n title: 'MyTests: Sample Event',\r\n notes: 'This is a test event which has some values assigned to it.',\r\n location: 'Appcelerator Inc',\r\n begin: date1,\r\n end: date2,\r\n availability: Ti.Calendar.AVAILABILITY_FREE,\r\n allDay: false,\r\n });\r\n var alert1 = event1.createAlert({\r\n relativeOffset:-(60201000), //20 minutes before\r\n });\r\n var allAlerts = new Array(alert1);\r\n event1.alerts = allAlerts;\r\n var newRule = event1.createRecurenceRule({\r\n frequency: Ti.Calendar.RECURRENCEFREQUENCY_MONTHLY,\r\n interval: 2\r\n }); // every two months\r\n Ti.API.info('newRule : '+ newRule);\r\n event1.recurrenceRules = [newRule];\r\n Ti.API.info('Going to save event now');\r\n event1.save(Ti.Calendar.SPAN_FUTUREEVENTS);\r\n\r\nevent_added = event1.id;\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n title: 'Calendar Demo',\r\n layout:'vertical'\r\n});\r\n\r\nvar btn1 = Ti.UI.createButton({\r\n title:'Create event',\r\n width:Ti.UI.SIZE, height:Ti.UI.SIZE,\r\n top:50\r\n});\r\nvar btn2 = Ti.UI.createButton({\r\n title:'Delete event',\r\n width:Ti.UI.SIZE, height:Ti.UI.SIZE,\r\n top:30\r\n});\r\n\r\nwin.add(btn1);\r\nwin.add(btn2);\r\n\r\nbtn1.addEventListener('click', function(e){\r\n performCalendarWriteFunctions();\r\n});\r\n\r\nbtn2.addEventListener('click', function(e){\r\n var defCalendar = Ti.Calendar.defaultCalendar;\r\n var event = defCalendar.getEventById(event_added);\r\n Ti.API.error('event is: ' + event);\r\n if (event != null)\r\n {\r\n Ti.API.info('deleting: ' + event_added);\r\n event.remove(Ti.Calendar.SPAN_FUTUREEVENTS);\r\n }\r\n else\r\n {\r\n alert('could not delete this event because it does not exist!');\r\n }\r\n});\r\n\r\nif(Ti.Calendar.eventsAuthorization == Ti.Calendar.AUTHORIZATION_AUTHORIZED) {\r\n //performCalendarWriteFunctions();\r\n} else {\r\n Ti.Calendar.requestEventsAuthorization(function(e){\r\n if (e.success) {\r\n //performCalendarWriteFunctions();\r\n } else {\r\n alert('Access to calendar is not allowed');\r\n }\r\n });\r\n}\r\nwin.open();\r\n{code}\r\n\r\n- Additional info\r\nObject ID appears to be removed but future events are not. Device logs since simulator lacks the ability to browse the ical.\r\n{code}\r\n��Jun 19 11:43:21 lAlO AppLeak[743] : [INFO] Date1 : Wed Jun 19 2013 11:43:24 GMT-0500 (CDT)Date2 : Wed Jun 19 2013 11:58:21 GMT-0500 (CDT)\r\n��Jun 19 11:43:21 lAlO AppLeak[743] : [INFO] newRule : [object TiCalendarRecurrenceRule]\r\n��Jun 19 11:43:21 lAlO AppLeak[743] : [INFO] Going to save event now\r\n��Jun 19 11:43:29 lAlO AppLeak[743] : [INFO] event is: [object 3C241C03-7423-44ED-8901-C70340F92B6C:C1F4CEE0-C3EB-4AA5-8D2F-5B5D6B894C9E]\r\n��Jun 19 11:43:29 lAlO AppLeak[743] : [INFO] deleting: 3C241C03-7423-44ED-8901-C70340F92B6C:C1F4CEE0-C3EB-4AA5-8D2F-5B5D6B894C9E\r\n{code}\r\n\r\n- Developer remarks\r\n\"Paradoxically, trying to delete more than once (I refer to same event id) it successfully retrieves the event for some reason, although this event has been deleted from ical...\"", "attachment": [], "flagged": false, "summary": "iOS: Calendar future occurrences are not deleted", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "iOS 6.1 \r\nDevices under test iPhone 4 & iPad Mini\r\nTitanium SDK: 3.1", "comment": { "comments": [ { "id": "259069", "author": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reproduced issue with iPad Mini 6.1.3", "updateAuthor": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-21T22:34:05.000+0000", "updated": "2013-06-21T22:34:05.000+0000" }, { "id": "260667", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR against master : https://github.com/appcelerator/titanium_mobile/pull/4435", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-02T21:59:35.000+0000", "updated": "2013-07-02T21:59:35.000+0000" }, { "id": "263268", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport to 3_1_X\nhttps://github.com/appcelerator/titanium_mobile/pull/4494", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-25T22:29:55.000+0000", "updated": "2013-07-25T22:29:55.000+0000" }, { "id": "266700", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix & now the future calender events do get deleted along with the current one.\r\nThus closing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.1.2.201308091728\r\nTi SDK : 3.1.2.v20130814124556\r\nMac OSX : 10.8.4\r\nAlloy : 1.2.0-beta\r\nCLI - 3.1.2-alpha\r\nIpad4 - 6.0.1\r\nIphone5 - 6.0\r\n\r\n", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-15T17:39:14.000+0000", "updated": "2013-08-15T17:39:14.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }