{ "id": "134799", "key": "AC-3232", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "2014-09-05T19:28:46.000+0000", "created": "2014-08-15T13:39:35.000+0000", "labels": [ "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:57:38.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": [], "description": "h3. Steps to Reproduce\nI have a global value for new Date() called Alloy.Globals.dates.today populated with the moment() method.\n\nAt the moment, I cannot use the global reference in my date picker like this\nvar datePicker = Ti.UI.createPicker({\n maxDate : Alloy.Globals.dates.today\n});\n\nI think this has more to do with moment.js than the Javascript Date object. Since moment.js is supported, I would expect to be able to use it as I see fit.\n\nh3. Actual Result\npicker is disabled.\n\nh3. Expected Result\nsets maxDate to today.", "attachment": [], "flagged": false, "summary": "Improve date picker to use Alloy.Globals reference", "creator": { "name": "mjstelly_ta", "key": "mjstelly_ta", "displayName": "Michael Stelly", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "mjstelly_ta", "key": "mjstelly_ta", "displayName": "Michael Stelly", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium Studio 3.3.0", "comment": { "comments": [ { "id": "319244", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe have tested this issue. Its work as expected, we can use alloy global variable (which is populated with the moment() method) inside the date picker.\r\n\r\nh3.Testing Environment: \r\nTitanium SDK: 3.3.0.GA,\r\nTitanium CLI: 3.3.0,\r\nAndroid SDK: 4.4.3, 4.2.2,\r\nAlloy:1.4.1,\r\niOS SDK:7.1,\r\nOS X Version: 10.9.4,\r\nAppcelerator Studio: 3.3.0\r\n\r\nh3.Steps to test the issue:\r\n1. Create a Alloy project.\r\n2. Paste this code in alloy.js, index.js and index.xml file.\r\n3. Run this code with the testing environment.\r\n\r\nh3.Test Code\r\n{code:title=alloy.js}\r\nvar moment = require('alloy/moment');\r\nvar today = moment().toDate();\r\n\r\nTi.API.info(today);\r\n\r\nAlloy.Globals.todays = today;\r\n\r\n{code}\r\n\r\n{code:title=index.xml}\r\n\r\n\t\r\n\r\n{code}\r\n\r\n{code:title=index.js}\r\n\r\nvar picker = Ti.UI.createPicker({\r\n\ttype : Ti.UI.PICKER_TYPE_DATE,\r\n\tminDate : new Date(2009, 0, 1),\r\n\tmaxDate : Alloy.Globals.todays,\r\n\tvalue : new Date(2013, 4, 10)\r\n});\r\n\r\n$.win.add(picker);\r\n\r\n$.win.open();\r\n\r\n{code}\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-08-19T07:34:42.000+0000", "updated": "2014-09-05T19:28:16.000+0000" }, { "id": "322110", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Please take a look into the testcase.", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-09-05T19:28:46.000+0000", "updated": "2014-09-05T19:28:46.000+0000" }, { "id": "322111", "author": { "name": "mjstelly_ta", "key": "mjstelly_ta", "displayName": "Michael Stelly", "active": true, "timeZone": "America/New_York" }, "body": "Thanks, Mauro. I will.", "updateAuthor": { "name": "mjstelly_ta", "key": "mjstelly_ta", "displayName": "Michael Stelly", "active": true, "timeZone": "America/New_York" }, "created": "2014-09-05T19:29:55.000+0000", "updated": "2014-09-05T19:29:55.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }