{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments/81173971","pull_request_review_id":2173697,"id":81173971,"diff_hunk":"@@ -56,224 +56,215 @@ var DATE_FORMATS = {\n     ], function(\n         $,\n         StringUtils,\n-        MomentLib,\n-        MomentTZ\n+        moment,\n+        momentTZ\n         ) {\n+        var DateUtils, isValid, dateObject, userTimezone, localizeTime, timeDisplay, localize;\n+\n         /**\n-         * Create a formatted, locale-aware string representation of a datetime.\n-         *\n-         * These functions are meant to act as a general localization function\n-         * for UTC datetime objects, creating platform-friendly strings in the user's\n-         * local timezone formatted to the user's preferred language\n-         *\n-         * Most of the heavy lifting is done by the 'moments' js library,\n-         * with the moment-with-locales and moment-timezones add-ons\n-         *\n-         * by sending preferences data, even in an incomplete state, we can generate the appropriate\n-         * datetime for surfacing on the frontend\n-         *\n-         * for example, if you're a French speaker currently accessing the site in Rangoon,\n-         * who you have not set your timezone preferences:\n-         *\n-         * var context = {\n-         *    datetime: '2016-10-14 08:00:00+00:00',\n-         *    language: \"fr\",\n-         *    }\n-         * DateUtils.localize(context)\n-         *\n-         * which will render: '14 oct. 2016 14:30 MMT'\n+         * Helper function to determine variable/context validity.\n          *\n+         * @param {string} variable to test","path":"src/js/utils/date-utils.js","position":null,"original_position":110,"commit_id":"5754fecaf841b3a8f5c52e351d0228afe690655a","original_commit_id":"5754fecaf841b3a8f5c52e351d0228afe690655a","user":{"login":"yro","id":7050866,"avatar_url":"https://avatars.githubusercontent.com/u/7050866?v=3","gravatar_id":"","url":"https://api.github.com/users/yro","html_url":"https://github.com/yro","followers_url":"https://api.github.com/users/yro/followers","following_url":"https://api.github.com/users/yro/following{/other_user}","gists_url":"https://api.github.com/users/yro/gists{/gist_id}","starred_url":"https://api.github.com/users/yro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yro/subscriptions","organizations_url":"https://api.github.com/users/yro/orgs","repos_url":"https://api.github.com/users/yro/repos","events_url":"https://api.github.com/users/yro/events{/privacy}","received_events_url":"https://api.github.com/users/yro/received_events","type":"User","site_admin":false},"body":"Done. candidateVariable (since it's not always a date). ","created_at":"2016-09-29T16:10:02Z","updated_at":"2016-09-29T16:10:03Z","html_url":"https://github.com/edx/edx-ui-toolkit/pull/85#discussion_r81173971","pull_request_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments/81173971"},"html":{"href":"https://github.com/edx/edx-ui-toolkit/pull/85#discussion_r81173971"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85","id":87145075,"html_url":"https://github.com/edx/edx-ui-toolkit/pull/85","diff_url":"https://github.com/edx/edx-ui-toolkit/pull/85.diff","patch_url":"https://github.com/edx/edx-ui-toolkit/pull/85.patch","issue_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/85","number":85,"state":"open","locked":false,"title":"DateUtil, moment req, tests","user":{"login":"yro","id":7050866,"avatar_url":"https://avatars.githubusercontent.com/u/7050866?v=3","gravatar_id":"","url":"https://api.github.com/users/yro","html_url":"https://github.com/yro","followers_url":"https://api.github.com/users/yro/followers","following_url":"https://api.github.com/users/yro/following{/other_user}","gists_url":"https://api.github.com/users/yro/gists{/gist_id}","starred_url":"https://api.github.com/users/yro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yro/subscriptions","organizations_url":"https://api.github.com/users/yro/orgs","repos_url":"https://api.github.com/users/yro/repos","events_url":"https://api.github.com/users/yro/events{/privacy}","received_events_url":"https://api.github.com/users/yro/received_events","type":"User","site_admin":false},"body":"## Description\r\nThe intention of this PR is to get some early code review before roping in documentation and product. A formal PR with the requisite requirements below all seen to will follow.\r\n\r\n## [TNL-5565](https://openedx.atlassian.net/browse/TNL-5565)\r\n\r\nThis add a language/timezone aware datetime formatting utility.\r\n\r\n## Manual Test Plan\r\nNone that I am aware of\r\n\r\n## Testing Checklist\r\n- [x] Write unit tests for all new features.\r\n- [-] Write accessibility (a11y) tests for all new UI.\r\n- [x] Manually test responsive behavior.\r\n\r\n## Non-testing Checklist\r\n- [ ] Consider any documentation your change might need, and which users will be affected by this change.\r\n- [ ] Consult with the Pattern Library team if adding a new component.\r\n\r\n## Post-review\r\n- [x] Squash commits into discrete sets of changes with descriptive commit messages.\r\n\r\n## Reviewers\r\nTODO: In this section, tag specific reviewers you know will want to have a look at this PR. You can use the checklist below for organization:\r\n\r\n- [ ] @nasthagiri \r\n- [ ] @efischer19 \r\n\r\nIf you've been tagged for review, please check your corresponding box once you've given the :+1:.\r\n\r\nWe'll also automatically suggest reviewers for this PR based on the code it touches.\r\n\r\n","created_at":"2016-09-28T15:37:02Z","updated_at":"2016-09-29T16:10:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd5563c24086f3f59a21ef88077da35a4b30c4dd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85/commits","review_comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85/comments","review_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/85/comments","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/5754fecaf841b3a8f5c52e351d0228afe690655a","head":{"label":"edx:yro_datetime-utils","ref":"yro_datetime-utils","sha":"5754fecaf841b3a8f5c52e351d0228afe690655a","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":40644985,"name":"edx-ui-toolkit","full_name":"edx/edx-ui-toolkit","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-ui-toolkit","description":"A JavaScript toolkit for building edX user interfaces.","fork":false,"url":"https://api.github.com/repos/edx/edx-ui-toolkit","forks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/forks","keys_url":"https://api.github.com/repos/edx/edx-ui-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-ui-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-ui-toolkit/teams","hooks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/events","assignees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-ui-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/tags","blobs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-ui-toolkit/languages","stargazers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscription","commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-ui-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-ui-toolkit/merges","archive_url":"https://api.github.com/repos/edx/edx-ui-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-ui-toolkit/downloads","issues_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-ui-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-ui-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-ui-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-ui-toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/deployments","created_at":"2015-08-13T07:28:13Z","updated_at":"2016-07-13T15:12:40Z","pushed_at":"2016-09-29T15:10:38Z","git_url":"git://github.com/edx/edx-ui-toolkit.git","ssh_url":"git@github.com:edx/edx-ui-toolkit.git","clone_url":"https://github.com/edx/edx-ui-toolkit.git","svn_url":"https://github.com/edx/edx-ui-toolkit","homepage":"http://ui-toolkit.edx.org","size":2191,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":8,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"b57c996c0f46a41dabed51132812819461105fa9","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":40644985,"name":"edx-ui-toolkit","full_name":"edx/edx-ui-toolkit","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-ui-toolkit","description":"A JavaScript toolkit for building edX user interfaces.","fork":false,"url":"https://api.github.com/repos/edx/edx-ui-toolkit","forks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/forks","keys_url":"https://api.github.com/repos/edx/edx-ui-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-ui-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-ui-toolkit/teams","hooks_url":"https://api.github.com/repos/edx/edx-ui-toolkit/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-ui-toolkit/events","assignees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-ui-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/tags","blobs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-ui-toolkit/languages","stargazers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-ui-toolkit/subscription","commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-ui-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-ui-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-ui-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-ui-toolkit/merges","archive_url":"https://api.github.com/repos/edx/edx-ui-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-ui-toolkit/downloads","issues_url":"https://api.github.com/repos/edx/edx-ui-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-ui-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-ui-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-ui-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-ui-toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-ui-toolkit/deployments","created_at":"2015-08-13T07:28:13Z","updated_at":"2016-07-13T15:12:40Z","pushed_at":"2016-09-29T15:10:38Z","git_url":"git://github.com/edx/edx-ui-toolkit.git","ssh_url":"git@github.com:edx/edx-ui-toolkit.git","clone_url":"https://github.com/edx/edx-ui-toolkit.git","svn_url":"https://github.com/edx/edx-ui-toolkit","homepage":"http://ui-toolkit.edx.org","size":2191,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85"},"html":{"href":"https://github.com/edx/edx-ui-toolkit/pull/85"},"issue":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/85"},"comments":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-ui-toolkit/statuses/5754fecaf841b3a8f5c52e351d0228afe690655a"}}}}
{"actor":{"display_login":"yro"}}