{ "id": "113294", "key": "TIMOB-13659", "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": "2013-04-23T18:39:20.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "reprod" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:23.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": "*Problem description*\r\nI have built a simple Alloy test case that passes a date object between two controllers by firing Ti.App.fireEvent. Tested in iOS 6.1 simulator on Mountain Lion. Titantium 3.1.0.GA. But this occurs with 3.0.2.GA as well.\r\n\r\n*Test case*\r\n{code:javascript}\r\nfunction buttonClick() {\r\n\tvar time = new Date('4/21/2013 11:45 am');\r\n\r\n\tvar argInfo = {\r\n\t\teventTime : time\r\n\t};\r\n\tTi.API.info('starting time: ' + JSON.stringify(argInfo));\r\n\r\n\tTi.App.fireEvent(\"testEvent\", argInfo);\r\n}\r\n\r\nTi.App.addEventListener('testEvent', function(info) {\r\n\tTi.API.info(\" in event time: \" + info.eventTime.toString());\r\n});\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#FFF\"\r\n});\r\n\r\nvar button = Titanium.UI.createButton({\r\n\ttitle : 'Fire Event',\r\n\ttop : 10,\r\n\twidth : 100,\r\n\theight : 50\r\n});\r\nbutton.addEventListener('click', buttonClick);\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n\r\n*Console output*\r\n{code}\r\n[INFO] starting time: {\"eventTime\":\"2013-04-21T15:45:00.000Z\"}\r\n[INFO] in event time: Sun Apr 21 2013 11:46:02 GMT-0400 (EDT)\r\n{code}\r\n\r\n*Note*\r\nThe time prior to firing the event is 15:45, but when it arrives the minutes are now: 46.02\r\nI presume this is a problem with the serializing of the date object.\r\nPerhaps Data() objects are not legal for events, but they used to work, this is old code that has now stopped working.\r\nIf they are not legal, Titanium should throw an error or it should be documented.\r\n\r\n*Workaround*\r\nPass the date as:\r\n{code:javascript}newDate().toString(){code}", "attachment": [ { "id": "37754", "filename": "test.zip", "author": { "name": "kenny", "key": "kenny", "displayName": "Joel Margolese", "active": true, "timeZone": "America/New_York" }, "created": "2013-04-23T18:42:08.000+0000", "size": 8914514, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Date() value gets changed when passed via events", "creator": { "name": "kenny", "key": "kenny", "displayName": "Joel Margolese", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "kenny", "key": "kenny", "displayName": "Joel Margolese", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium 3.0.2.GA or 3.1.0.GA (tested using iOS simulator as target.)", "comment": { "comments": [ { "id": "248788", "author": { "name": "kenny", "key": "kenny", "displayName": "Joel Margolese", "active": true, "timeZone": "America/New_York" }, "body": "deleted build folder, not sure why, but it was 90MB.", "updateAuthor": { "name": "kenny", "key": "kenny", "displayName": "Joel Margolese", "active": true, "timeZone": "America/New_York" }, "created": "2013-04-23T18:42:08.000+0000", "updated": "2013-04-23T18:42:08.000+0000" }, { "id": "248812", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and sort of confirmed on iOS 6 simulator, Ti SDK 3.1 GA. This is the output I get:\n\n{code}[INFO] : \b\b \b starting time: {\"eventTime\":\"2013-04-21T18:45:00.000Z\"}\n[INFO] : \b\b \b in event time: Sun Apr 21 2013 11:45:10 GMT-0700 (PDT){code}\n\nSo there's about 10 seconds difference here...", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-23T22:07:39.000+0000", "updated": "2013-04-23T22:07:39.000+0000" }, { "id": "423855", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 6 (10.0)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1 GA\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.2\r\nTi CLI 5.0.14\r\nAlloy 1.9.11\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-10T23:14:36.000+0000", "updated": "2017-07-10T23:14:36.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }