{ "id": "174467", "key": "TIMOB-27625", "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": "21018", "name": "Release 9.0.2", "archived": false, "released": true, "releaseDate": "2020-05-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-05-04T12:58:06.000+0000", "created": "2019-11-22T15:10:14.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-05-04T12:58:06.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": "When you set maxDate twice on a Ti.UI.Picker the first maxDate is still the maximum date I can set.\r\n\r\n*To reproduce*\r\n# Press \"Set Max Date\"\r\n# Try to set the picker to the new maxDate\r\n\r\n{code:java}\r\nvar maxDate = new Date();\r\n\r\nvar window = Ti.UI.createWindow({\r\n layout: \"vertical\",\r\n backgroundColor: \"#454441\"\r\n});\r\n\r\nvar picker = Ti.UI.createPicker({\r\n type: Ti.UI.PICKER_TYPE_DATE,\r\n maxDate: maxDate\r\n});\r\nwindow.add(picker);\r\n\r\nvar button = Ti.UI.createButton({\r\n title: \"Set Max Date\"\r\n});\r\nbutton.addEventListener(\"click\", function() {\r\n picker.maxDate = new Date(maxDate.getFullYear() + 1, maxDate.getMonth(), maxDate.getDate());\r\n});\r\nwindow.add(button);\r\n\r\nwindow.open();\r\n{code}\r\n\r\n*Expected behavior*\r\nThe user is able to set the date to the new maxDate.\r\n\r\n*Actual behavior*\r\nThe picker keeps resetting to the first maxDate.\r\n\r\n*Note*\r\nI think this is because the TiUIDatePicker class is using a maxDate variable (I think minDate has the same problem) to check if a date change is allowed (line 165), but it's only updating this property in processProperties and not in propertyChanged. \r\n\r\nI'm able to work around this issue by setting a high maxDate at initialization before I start updating the maxDate. This confirms my suspicion above.", "attachment": [], "flagged": false, "summary": "Android: Setting picker's minDate/maxDate after opening window not correctly applied", "creator": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "teunklijn@telfort.nl", "key": "teunklijn@telfort.nl", "displayName": "Teun Klijn", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Android; 7.5.0.GA; 8.3.0", "closedSprints": [ { "id": 1194, "state": "closed", "name": "2020 Sprint 9", "startDate": "2020-04-24T17:09:51.572Z", "endDate": "2020-05-08T17:09:00.000Z", "completeDate": "2020-05-08T15:40:07.869Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "452906", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "I have confirmed this is a valid issue and can be reproduced. Moving to TIMOB.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-11-25T11:49:03.000+0000", "updated": "2019-11-25T11:49:03.000+0000" }, { "id": "452920", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "-PR:- https://github.com/appcelerator/titanium_mobile/pull/11369\r\n\r\nClosing in favor of below PR.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-26T17:28:40.000+0000", "updated": "2020-04-11T04:08:02.000+0000" }, { "id": "455092", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11621\r\nPR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11622", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-11T04:07:44.000+0000", "updated": "2020-04-11T04:19:33.000+0000" }, { "id": "455255", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed for Master and 9_0_X, waiting on Jenkins build", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-27T13:19:31.000+0000", "updated": "2020-04-27T13:19:31.000+0000" }, { "id": "455278", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master and 9_0_X", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-04-28T13:40:32.000+0000", "updated": "2020-04-28T13:40:32.000+0000" }, { "id": "455344", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket.* Fix verified in SDK version 9.1.0.v20200501090150 and 9.0.2.v20200430111828 \r\n\r\nTest and other information can be found at:\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/11621\r\nPR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11622", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-05-04T12:57:55.000+0000", "updated": "2020-05-04T12:57:55.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }