{ "id": "62339", "key": "TIMOB-1707", "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": { "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": "2012-07-25T17:57:53.000+0000", "created": "2011-04-15T03:00:05.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "date", "defect", "ios", "iphone", "picker" ], "versions": [], "issuelinks": [ { "id": "19375", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-26T22:18:55.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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

Using the KS as the example, whenever you move the Date Picker\nfrom Jan 1 to Jan 2 (by moving the day-of-month up 1) for any year,\nthe 'change' event handler's e.value.getFullYear() [and\ne.value.getUTCFullYear() for that matter] is off by one year.

\n

\nhttp://github.com/appcelerator/titanium_mobile/blob/master/demos/Ki...

{html}", "attachment": [], "flagged": false, "summary": "Date Picker off by a year on iOS 4 sdk 1.4 & 1.4.1", "creator": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ctredway1", "key": "ctredway1", "displayName": "ctredway", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "209500", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce in SDK 2.2.0.014b86f on iPhone Sim 5.1.\r\n\r\nTest code:\r\n{code}\r\nvar win = Titanium.UI.createWindow();\r\nwin.backgroundColor = 'black';\r\n\r\nvar minDate = new Date();\r\nminDate.setFullYear(2009);\r\nminDate.setMonth(0);\r\nminDate.setDate(1);\r\n\r\nvar maxDate = new Date();\r\nmaxDate.setFullYear(2009);\r\nmaxDate.setMonth(11);\r\nmaxDate.setDate(31);\r\n\r\nvar value = new Date();\r\nvalue.setFullYear(2009);\r\nvalue.setMonth(0);\r\nvalue.setDate(1);\r\n\r\nvar picker = Ti.UI.createPicker({\r\n type:Ti.UI.PICKER_TYPE_DATE,\r\n minDate:minDate,\r\n maxDate:maxDate,\r\n value:value\r\n});\r\n\r\n// turn on the selection indicator (off by default)\r\npicker.selectionIndicator = true;\r\n\r\nwin.add(picker);\r\n\r\nvar label = Ti.UI.createLabel({\r\n text:'Choose a date',\r\n top:6,\r\n width:'auto',\r\n height:'auto',\r\n textAlign:'center',\r\n color:'white'\r\n});\r\nwin.add(label);\r\n\r\npicker.addEventListener('change',function(e)\r\n{\r\n label.text = e.value.toLocaleString();\r\n Ti.API.info(e.value.getFullYear());\r\n Ti.API.info(e.value.getUTCFullYear());\r\n});\r\n\r\nvar locale = false;\r\nvar localebutton = Ti.UI.createButton({\r\n title:'Change locale',\r\n bottom:20,\r\n width:200,\r\n height:40\r\n});\r\nlocalebutton.addEventListener('click', function() {\r\n if (!locale) {\r\n picker.setLocale('ru');\r\n locale = true;\r\n }\r\n else {\r\n locale = false;\r\n picker.setLocale(Titanium.Platform.locale);\r\n }\r\n});\r\nwin.add(localebutton);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-25T17:57:53.000+0000", "updated": "2012-07-25T17:57:53.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }