{ "id": "124823", "key": "TIMOB-16243", "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": [], "resolution": null, "resolutiondate": null, "created": "2014-01-15T13:58:35.000+0000", "priority": null, "labels": [ "date", "fireevent", "ios" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:22.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nWhen date objects are sent as part of the object that is the argument of a global event (Ti.App.fireEvent()) they are modified so that the received date is not the same as the one that was sent.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.UI.createWindow().open();\r\n\r\nvar a = new Date(2014,1,15,1,2,3);\r\n\r\nTi.App.addEventListener(\"test\", fn);\r\n\r\nTi.App.fireEvent(\"test\", {\r\n\tData: a\r\n});\r\n\r\nfunction fn(e) {\r\n\talert(\"Expected: \" + a.toString() + \" What was received: \" + e.Data.toString());\r\n}\r\n\r\n\r\n{code}\r\n\r\nh2. Discussions\r\n\r\nRun the test case above and you will see that obviously the date is changed during \"transfer\". (It does not seem to happen on Android). I guess there is something that differs between how objective-c and the javascript engine handles Date objects.\r\n", "attachment": [], "flagged": false, "summary": "iOS: Date objects are messed up when sent through a global event", "creator": { "name": "karl.n", "key": "karl.n", "displayName": "Karl Nilsson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "karl.n", "key": "karl.n", "displayName": "Karl Nilsson", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK: 3.1.3, 3.2.0\r\niOS: Simulator (6.x) + Device (6.1.3)", "comment": { "comments": [ { "id": "301837", "body": "This issue was previously scheduled to be worked on in more than one sprint:\r\n* 'Release 3.1.2' (on board '3.1.X Triage')\r\n* 'Release 3.0.1/TS 3.0.2' (on board '3.1.0 Triage')\r\n* 'Triage' (on board '3.2.X Triage')\r\n\r\nStarting from JIRA Agile 6.3, an issue can only belong to a single future sprint. Read more about this change: http://docs.atlassian.com/agile/docs-0630/Sprint+Marker+Migration\r\n\r\nThis issue is now scheduled for future sprint 'Release 3.1.2' (on board '3.1.X Triage').\r\n\r\nIf this is incorrect, please update the issue accordingly.\r\n\r\nThis comment was automatically generated by JIRA. If it is no longer relevant, please feel free to delete it.", "created": "2014-04-21T15:32:17.000+0000", "updated": "2014-04-21T15:32:17.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }