{ "id": "136228", "key": "ALOY-1132", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "16692", "name": "Alloy 1.7.0", "archived": false, "released": true, "releaseDate": "2015-07-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-09-17T03:57:57.000+0000", "created": "2014-09-08T18:32:40.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-3.4.0" ], "versions": [ { "id": "15909", "description": "Alloy 1.5.0", "name": "Alloy 1.5.0", "archived": false, "released": true, "releaseDate": "2014-09-29" }, { "id": "16389", "name": "Alloy 1.4.1", "archived": false, "released": true, "releaseDate": "2014-07-28" } ], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-10-23T19:47:55.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12600", "name": "Samples & Templates" } ], "description": "h5. Problem description\r\nSample code for ALOY-1058 is using a value for the type property with quotes, while, setting the type from the TSS, it should be used with no quotes.\r\nNot a regression. \r\n\r\nFrom the sample code \"index.tss\", type is defined in this way:\r\n{code}\r\n\"#picker\":{\r\n\ttype:\"Ti.UI.PICKER_TYPE_DATE\"\r\n}\r\n{code}\r\n\r\nwhile type should be:\r\n{code}\r\ntype: Ti.UI.PICKER_TYPE_DATE\r\n{code}\r\n\r\nh5. Steps to reproduce\r\n1. Run the sample code\r\nResult: Running the sample, the picker is actually showing DATE as a type when run, but the constant values should be used with no quotes in the TSS.\r\nHere is the compiled code from Resources/iphone/alloy/controller/index.js:\r\n{code}\r\n $.__views.picker = Ti.UI.createPicker({\r\n type: \"Ti.UI.PICKER_TYPE_DATE\",\r\n id: \"picker\",\r\n minDate: new Date(\"Tue Apr 01 2014 00:00:00 GMT-0700 (PDT)\"),\r\n maxDate: new Date(\"Thu May 01 2014 12:00:00 GMT-0700 (PDT)\"),\r\n value: new Date(\"Tue Apr 15 2014 12:00:00 GMT-0700 (PDT)\")\r\n });\r\n{code}\r\n\r\n2. Change index.tss picker stile to:\r\n{code}\r\n\"#picker\":{\r\n\ttype:Ti.UI.PICKER_TYPE_DATE_AND_TIME\r\n}\r\n{code}\r\n\r\nResult: compiled code is:\r\n{code}\r\n $.__views.picker = Ti.UI.createPicker({\r\n type: \"Ti.UI.PICKER_TYPE_DATE_AND_TIME\",\r\n id: \"picker\",\r\n minDate: new Date(\"Tue Apr 01 2014 00:00:00 GMT-0700 (PDT)\"),\r\n maxDate: new Date(\"Thu May 01 2014 12:00:00 GMT-0700 (PDT)\"),\r\n value: new Date(\"Tue Apr 15 2014 12:00:00 GMT-0700 (PDT)\")\r\n });\r\n{code} \r\n\r\nHowever, DATE type picker is still shown (not DATE_AND_TIME).\r\nConsidering the generated code, this could be a behavior issue relative to how SDK is handling the Picker type property, not Alloy. Investigating and creating a Classic Titanium sample.\r\n\r\n3. Change the picker style to: \r\n{code}\r\n\"#picker\":{\r\n\ttype:Ti.UI.PICKER_TYPE_DATE_AND_TIME\r\n}\r\n{code}\r\n\r\nResult: Picker DATE_AND_STYLE is shown. Compiled code also looks good:\r\n{code}\r\n $.__views.picker = Ti.UI.createPicker({\r\n type: Ti.UI.PICKER_TYPE_DATE_AND_TIME,\r\n id: \"picker\",\r\n minDate: new Date(\"Tue Apr 01 2014 00:00:00 GMT-0700 (PDT)\"),\r\n maxDate: new Date(\"Thu May 01 2014 12:00:00 GMT-0700 (PDT)\"),\r\n value: new Date(\"Tue Apr 15 2014 12:00:00 GMT-0700 (PDT)\")\r\n });\r\n{code}\r\n\r\nh5. Note\r\nMy suggestion for the sample is to use the DATE_AND_TIME picker as type in case of iOS.\r\ni.e.\r\n{code}\r\n\"#picker\":{\r\n\ttype:Ti.UI.PICKER_TYPE_DATE\r\n}\r\n\r\n\"#picker[platform=ios]\":{\r\n\ttype:Ti.UI.PICKER_TYPE_DATE_AND_TIME\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": " 'testing/ALOY-1058' sample code is using quoted type value", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.4.0.v20140903121714\r\nAppcelerator Studio 3.4.0.201409032106 \r\nCLI 3.4.0-beta\r\nAlloy 1.5.0-beta2\r\nXcode6-beta7", "closedSprints": [ { "id": 217, "state": "closed", "name": "2014 Sprint 19 Alloy", "startDate": "2014-09-15T12:45:43.956Z", "endDate": "2014-09-29T12:45:00.000Z", "completeDate": "2014-09-29T13:30:39.342Z", "originBoardId": 124 } ], "comment": { "comments": [ { "id": "323734", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR: https://github.com/appcelerator/alloy/pull/563\r\n\r\nFunctional test: run the ALOY-1058 sample on ios and android simulators, no errors, and you get the date-time or date pickers respectively. Examine the generated code to see that the constant is supplied to the picker constructor without quotes.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-09-15T18:21:31.000+0000", "updated": "2014-09-15T18:21:31.000+0000" }, { "id": "324156", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR merged.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2014-09-17T03:57:57.000+0000", "updated": "2014-09-17T03:57:57.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }