{ "id": "147744", "key": "ALOY-1265", "fields": { "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true }, "parent": { "id": "151858", "key": "ALOY-1315", "fields": { "summary": "Update out-of-date Alloy dependencies.", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "17081", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" }, { "id": "17582", "name": "alloy 1.7.30", "archived": false, "released": true, "releaseDate": "2015-12-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-12-17T18:43:03.000+0000", "created": "2015-05-12T19:28:41.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Alloy", "moment.js" ], "versions": [ { "id": "17537", "name": "alloy 1.7.29", "archived": false, "released": true, "releaseDate": "2015-11-30" } ], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2016-02-02T23:08:45.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": "13610", "name": "Builtins", "description": "Builtin Javascript libraries" } ], "description": "Moment.js has changed how it handles time zones/UTC. Took me forever to figure out why my calls to {{moment().utcOffset();}} didn't work.", "attachment": [ { "id": "57801", "filename": "Simulator Screen Shot 17 Dec 2015 10.03.24.png", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-17T09:09:31.000+0000", "size": 125059, "mimeType": "image/png" } ], "flagged": false, "summary": "Update builtin moment.js library to 2.10.6 (or latest)", "creator": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "352425", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Since the new versions of Moment use {{require()}} in *all* of the [locale files|https://github.com/moment/moment/blob/develop/locale/af.js#L6] it might be worth considering using the [version that has all the locales included|http://momentjs.com/downloads/moment-with-locales.js] so we don't need to patch it at all.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-05-13T13:30:05.000+0000", "updated": "2015-05-13T13:30:05.000+0000" }, { "id": "352426", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR on master: https://github.com/appcelerator/alloy/pull/687", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-05-13T13:33:44.000+0000", "updated": "2015-05-13T13:33:44.000+0000" }, { "id": "353049", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "The version also has a bigger file size than the one without locales included.\r\nmoment + locales : 361kb\r\nmoment : 85kb", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-05-20T05:10:51.000+0000", "updated": "2015-05-20T05:10:51.000+0000" }, { "id": "373174", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "PR: https://github.com/appcelerator/alloy/pull/747", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-12-17T04:39:04.000+0000", "updated": "2015-12-17T04:39:04.000+0000" }, { "id": "373193", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Verified with:\r\n\r\n{code:xml}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n{code:javascript}\r\nvar moment = require('alloy/moment');\r\nvar day = moment(\"2016-01-01\");\r\n\r\naddText(\"require('alloy/moment')\\nday = moment()\\nmoment.locale(): \" + moment.locale() + '\\nday.locale(): ' + day.locale() + '\\n' + day.format(\"LLL\"));\r\n\r\nrequire('alloy/moment/lang/en-gb');\r\nrequire('alloy/moment/lang/de');\r\nrequire('alloy/moment/lang/de-at');\r\nvar day2 = moment();\r\n\r\naddText(\"require('alloy/moment/lang/en-gb,de,de-at')\\nday2 = moment()\\nmoment.locale(): \" + moment.locale() + '\\nday.locale(): ' + day.locale() + '\\n' + day.format(\"LLL\") + '\\nday2.locale(): ' + day2.locale() + '\\n' + day2.format(\"LLL\"));\r\n\r\nmoment.locale(Ti.Locale.currentLocale);\r\nvar day3 = moment();\r\n\r\naddText(\"moment.locale(Ti.Locale.currentLocale = \" + Ti.Locale.currentLocale + \")\\nday3 = moment()\\nmoment.locale(): \" + moment.locale() + '\\nday.locale(): ' + day.locale() + '\\n' + day.format(\"LLL\") + '\\nday3.locale(): ' + day3.locale() + '\\n' + day3.format(\"LLL\"));\r\n\r\n['en-gb', 'de', 'de-at', 'foo'].forEach(function(locale) {\r\n day.locale(locale);\r\n addText(\"day.locale('\" + locale + \"')\\nmoment.locale(): \" + moment.locale() + '\\nday.locale(): ' + day.locale() + '\\n' + day.format(\"LLL\"));\r\n});\r\n\r\n$.index.open();\r\n\r\nfunction addText(text) {\r\n $.container.add(Ti.UI.createLabel({\r\n top: 10,\r\n textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n text: text\r\n }));\r\n}\r\n{code}\r\n\r\n!Simulator Screen Shot 17 Dec 2015 10.03.24.png|thumbnail!", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-17T09:09:57.000+0000", "updated": "2015-12-17T09:10:09.000+0000" }, { "id": "373195", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "A few notes on the PR:\r\n\r\n* We should leave the default locale to {{en}} as that is the only built-in locale moments has. So https://github.com/feons/alloy/blob/ALOY-1265-update/Alloy/builtins/moment.js#L2799 has to remain like https://github.com/moment/moment/blob/develop/moment.js#L2799\r\n* I actually wonder if the change to {{loadLocale}} (https://github.com/feons/alloy/blob/ALOY-1265-update/Alloy/builtins/moment.js#L269) makes sense. Since we require users to require any languages they want to support trying to load any other language will never succeed. So we might as well make {{loadLocale}} a NOOP or leave it as is will (which has same effect).\r\n\r\nWe also need to update https://appcelerator.github.io/appc-docs/platform/latest/#!/api/Alloy.builtins.moment to say:\r\n\r\n* That {{lang()}} is now deprecated and should be {{locale()}}\r\n* That any languages you want to support at run-time need to be required, hard-coded (no vars) so that Alloy includes them (must be very clear)\r\n* That the last required language will become the global locale.\r\n* That changes to the global locale will not effect already created instances.\r\n* That you can change the locale of a instance without affecting the global locale.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-17T09:20:52.000+0000", "updated": "2015-12-17T09:25:02.000+0000" }, { "id": "373222", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "1. leave default to locale to {{en}}, totally agree\r\n2. the change to {{loadLocale}} is needed, because users only have to explicitly do require when the language is not specified in the project's \"i18n\" folder.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-12-17T18:06:04.000+0000", "updated": "2015-12-17T18:06:04.000+0000" }, { "id": "373234", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "OK, with that change I approve ;)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-17T18:43:15.000+0000", "updated": "2015-12-17T18:43:15.000+0000" }, { "id": "373235", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "O wait, you probably want to include the API reference change in the PR as well?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-17T18:44:07.000+0000", "updated": "2015-12-17T18:44:07.000+0000" }, { "id": "373238", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Thank you for your approval! :D\r\nYes, will do.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-12-17T18:54:17.000+0000", "updated": "2015-12-17T18:54:17.000+0000" }, { "id": "375796", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nMacOS 10.11.3 (15D21)\r\nStudio 4.5.0.201601262138\r\nTi SDK 5.2.0.v20160202103508\r\nAppc NPM 4.2.3-1\r\nAppc CLI 5.2.0-239\r\nAlloy 1.7.33\r\nXcode 7.2 (7C68)\r\n\r\nmoment.js library is now using version 2.10.6 and time zones are working as expected. Tested with the provided samples above and simple calls to moment().utcOffset() in a modified sample Alloy app.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-02T23:08:45.000+0000", "updated": "2016-02-02T23:08:45.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }