{ "id": "64815", "key": "TIMOB-3742", "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": "11357", "description": "Mobile 1.8.0 M04", "name": "Sprint 2011-25", "archived": true, "released": true, "releaseDate": "2011-06-27" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-06-22T12:37:00.000+0000", "created": "2011-04-26T11:00:03.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-08-25T11:02:48.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h1. The Problem\r\nOn Android, the JavaScript \"Date\" object's \"toLocaleString\" function doesn't respect the \"Use 24-hour format\" setting in the \"Date & time settings\".\r\n\r\nh2. Code Sample\r\nFor example, place the following in an app.js.\r\n* It will create a new Date on October 1st, 2011 at 1pm.\r\n* Go in to the device's Settings app, then Date & time settings, and check \"Use 24-hour format\".\r\n* When you run the app, it will alert if the first 2 characters of theDate.toLocaleString() are 13, and thus if the 24-hour format is being used.\r\n\r\n{code:javascript}\r\nvar time = new Date(2011, 10, 1, 13, 0, 0).toLocaleTimeString();\r\nvar is24HourTime = time.substring(0, 2) == '13';\r\nalert(time + ': Is 24 Hour Time? ' + (is24HourTime ? 'Yes!' : 'No...'));\r\n{code}\r\n\r\nh2. Associated Helpdesk Ticket\r\nhttp://appc.me/c/WPP-21246-756", "attachment": [ { "id": "21226", "filename": "TIMOB-3742.js", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-21T14:10:14.000+0000", "size": 934, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: Date toLocaleString Doesn't Respect 24-hour Format", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Android Emulator APIs 2.2, Android Device running 2.2", "comment": { "comments": [ { "id": "157317", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Run the attached manual test case to verify this fix works", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-21T14:10:14.000+0000", "updated": "2011-06-21T14:10:37.000+0000" }, { "id": "157556", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/139 was merged. No 1.7.2 label is on this, so resolving.", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-06-22T12:37:00.000+0000", "updated": "2011-06-22T12:37:00.000+0000" }, { "id": "164021", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.v20110819142548\niPhone 4.3.4\niPad2 4.3.2\nMotorola Xoom 3.2\nNexus One 2.2.2", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-25T11:02:48.000+0000", "updated": "2011-08-25T11:02:48.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }