{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/comments/26797902","id":26797902,"diff_hunk":"@@ -105,27 +105,72 @@ function registerWith(Handlebars) {\n         return obj;\n     }\n \n-    function formatDate(date, formatOptions, options) {\n+    function formatDate(date, format, options) {\n         date = new Date(date);\n         assertIsDate(date, 'A date or timestamp must be provided to {{formatDate}}');\n-        return simpleFormat('date', date, formatOptions, options);\n+\n+        if (!options) {\n+            options = format;\n+            format  = null;\n+        }\n+\n+        var locales       = options.data.intl && options.data.intl.locales;\n+        var formatOptions = getFormatOptions('date', format, options);\n+\n+        return getDateTimeFormat(locales, formatOptions).format(date);\n     }\n \n-    function formatTime(date, formatOptions, options) {\n+    function formatTime(date, format, options) {\n         date = new Date(date);\n         assertIsDate(date, 'A date or timestamp must be provided to {{formatTime}}');\n-        return simpleFormat('time', date, formatOptions, options);\n+\n+        if (!options) {\n+            options = format;\n+            format  = null;\n+        }\n+\n+        var locales       = options.data.intl && options.data.intl.locales;\n+        var formatOptions = getFormatOptions('time', format, options);\n+\n+        return getDateTimeFormat(locales, formatOptions).format(date);\n     }\n \n-    function formatRelative(date, formatOptions, options) {\n+    function formatRelative(date, format, options) {\n         date = new Date(date);\n         assertIsDate(date, 'A date or timestamp must be provided to {{formatRelative}}');\n-        return simpleFormat('relative', date, formatOptions, options);\n+\n+        if (!options) {\n+            options = format;\n+            format  = null;\n+        }\n+\n+        var locales       = options.data.intl && options.data.intl.locales;\n+        var formatOptions = getFormatOptions('relative', format, options);\n+        var now           = options.hash.now;\n+\n+        // Remove `now` from the options passed to the `IntlRelativeFormat`\n+        // constructor, because it's only used when calling `format()`.\n+        if (formatOptions.hasOwnProperty('now')) {\n+            delete formatOptions.now;","path":"src/helpers.js","position":56,"original_position":56,"commit_id":"a1c63656c858e59590e88f33802f691252ab0f51","original_commit_id":"a1c63656c858e59590e88f33802f691252ab0f51","user":{"login":"ericf","id":29096,"avatar_url":"https://avatars.githubusercontent.com/u/29096?v=3","gravatar_id":"","url":"https://api.github.com/users/ericf","html_url":"https://github.com/ericf","followers_url":"https://api.github.com/users/ericf/followers","following_url":"https://api.github.com/users/ericf/following{/other_user}","gists_url":"https://api.github.com/users/ericf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericf/subscriptions","organizations_url":"https://api.github.com/users/ericf/orgs","repos_url":"https://api.github.com/users/ericf/repos","events_url":"https://api.github.com/users/ericf/events{/privacy}","received_events_url":"https://api.github.com/users/ericf/received_events","type":"User","site_admin":false},"body":"Yeah true, I'll remove the check.","created_at":"2015-03-19T21:09:08Z","updated_at":"2015-03-19T21:09:08Z","html_url":"https://github.com/yahoo/handlebars-intl/pull/63#discussion_r26797902","pull_request_url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63","_links":{"self":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/comments/26797902"},"html":{"href":"https://github.com/yahoo/handlebars-intl/pull/63#discussion_r26797902"},"pull_request":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63","id":31563661,"html_url":"https://github.com/yahoo/handlebars-intl/pull/63","diff_url":"https://github.com/yahoo/handlebars-intl/pull/63.diff","patch_url":"https://github.com/yahoo/handlebars-intl/pull/63.patch","issue_url":"https://api.github.com/repos/yahoo/handlebars-intl/issues/63","number":63,"state":"open","locked":false,"title":"Fix locale data and upgrade intl-* libs","user":{"login":"ericf","id":29096,"avatar_url":"https://avatars.githubusercontent.com/u/29096?v=3","gravatar_id":"","url":"https://api.github.com/users/ericf","html_url":"https://github.com/ericf","followers_url":"https://api.github.com/users/ericf/followers","following_url":"https://api.github.com/users/ericf/following{/other_user}","gists_url":"https://api.github.com/users/ericf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericf/subscriptions","organizations_url":"https://api.github.com/users/ericf/orgs","repos_url":"https://api.github.com/users/ericf/repos","events_url":"https://api.github.com/users/ericf/events{/privacy}","received_events_url":"https://api.github.com/users/ericf/received_events","type":"User","site_admin":false},"body":"This fixes the locale data by upgrading all the `intl-*` libs to latest, adds support for `selectordinal` arguments in messages, and the `now` option to `{{formatRelative}}`.\r\n\r\n## Fixed Locale Data\r\n\r\nThis vastly improves the locale data in the following ways:\r\n\r\n* Added locale data for all leaf locales which differ from their root locale's data; e.g. \"zh-Hant-TW\" is not the same as \"zh\".\r\n\r\n* Properly de-duplicate data for all CLDR locales by correctly traversing a locale's hierarchy of ancestor locales.\r\n\r\n* Added data for the following languages:\r\n  aa, agq, bas, bh, ckb, dav, dje, dsb, dua, dv, dyo, ebu, ewo, guw, guz, hsb, ia, in, iu, iw, jbo, ji, jv, jw, kaj, kam, kcg, khq, ki, kln, kok, ksf, ku, lb, lu, luo, luy, mer, mfe, mgh, mo, mua, nah, nmg, no, nqo, nus, ny, pap, prg, qu, rn, rw, sbp, sh, sma, smi, smj, smn, sms, swc, syr, tk, tl, twq, vai, wa, wo, yav, yi, zgh\r\n\r\n## Upgraded `intl-*` Dependencies\r\n\r\nThe following low-level FormatJS packages have also been upgraded which\r\nprovide and take advantaged of the improved CLDR locale data:\r\n\r\n* `grunt-extract-cldr-data@2.1.1`\r\n* `intl-messageformat@1.1.0`\r\n* `intl-relativeformat@1.1.0`\r\n\r\n## Added `selectordinal` Support for Messages\r\n\r\n`intl-messageformat@1.1.0` adds support for `selectordinal` arguments in messages; e.g.:\r\n\r\n```\r\nThis is my {year, selectordinal,\r\n    one {#st}\r\n    two {#nd}\r\n    few {#rd}\r\n    other{#th}\r\n} birthday.\r\n```\r\n\r\n## Added `now` Option to `{{formatRelative}}` Helper\r\n\r\n`intl-relativeformat@1.1.0` adds support for specifying the \"now\" value from which relative time is computed. This change adds a new `now` hash option to the `{{formatRelative}}` helper which will pass along that value to `IntlRelativeFormat#format()` method.\r\n\r\n","created_at":"2015-03-19T20:38:08Z","updated_at":"2015-03-19T21:09:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88827500b1fc9d225b08a0706c30b1ab20810dcc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63/commits","review_comments_url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63/comments","review_comment_url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/handlebars-intl/issues/63/comments","statuses_url":"https://api.github.com/repos/yahoo/handlebars-intl/statuses/a1c63656c858e59590e88f33802f691252ab0f51","head":{"label":"ericf:upgrade-intl-libs","ref":"upgrade-intl-libs","sha":"a1c63656c858e59590e88f33802f691252ab0f51","user":{"login":"ericf","id":29096,"avatar_url":"https://avatars.githubusercontent.com/u/29096?v=3","gravatar_id":"","url":"https://api.github.com/users/ericf","html_url":"https://github.com/ericf","followers_url":"https://api.github.com/users/ericf/followers","following_url":"https://api.github.com/users/ericf/following{/other_user}","gists_url":"https://api.github.com/users/ericf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericf/subscriptions","organizations_url":"https://api.github.com/users/ericf/orgs","repos_url":"https://api.github.com/users/ericf/repos","events_url":"https://api.github.com/users/ericf/events{/privacy}","received_events_url":"https://api.github.com/users/ericf/received_events","type":"User","site_admin":false},"repo":{"id":15742476,"name":"handlebars-intl","full_name":"ericf/handlebars-intl","owner":{"login":"ericf","id":29096,"avatar_url":"https://avatars.githubusercontent.com/u/29096?v=3","gravatar_id":"","url":"https://api.github.com/users/ericf","html_url":"https://github.com/ericf","followers_url":"https://api.github.com/users/ericf/followers","following_url":"https://api.github.com/users/ericf/following{/other_user}","gists_url":"https://api.github.com/users/ericf/gists{/gist_id}","starred_url":"https://api.github.com/users/ericf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericf/subscriptions","organizations_url":"https://api.github.com/users/ericf/orgs","repos_url":"https://api.github.com/users/ericf/repos","events_url":"https://api.github.com/users/ericf/events{/privacy}","received_events_url":"https://api.github.com/users/ericf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericf/handlebars-intl","description":"Handlebars helpers for internationalization.","fork":true,"url":"https://api.github.com/repos/ericf/handlebars-intl","forks_url":"https://api.github.com/repos/ericf/handlebars-intl/forks","keys_url":"https://api.github.com/repos/ericf/handlebars-intl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericf/handlebars-intl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericf/handlebars-intl/teams","hooks_url":"https://api.github.com/repos/ericf/handlebars-intl/hooks","issue_events_url":"https://api.github.com/repos/ericf/handlebars-intl/issues/events{/number}","events_url":"https://api.github.com/repos/ericf/handlebars-intl/events","assignees_url":"https://api.github.com/repos/ericf/handlebars-intl/assignees{/user}","branches_url":"https://api.github.com/repos/ericf/handlebars-intl/branches{/branch}","tags_url":"https://api.github.com/repos/ericf/handlebars-intl/tags","blobs_url":"https://api.github.com/repos/ericf/handlebars-intl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericf/handlebars-intl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericf/handlebars-intl/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericf/handlebars-intl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericf/handlebars-intl/statuses/{sha}","languages_url":"https://api.github.com/repos/ericf/handlebars-intl/languages","stargazers_url":"https://api.github.com/repos/ericf/handlebars-intl/stargazers","contributors_url":"https://api.github.com/repos/ericf/handlebars-intl/contributors","subscribers_url":"https://api.github.com/repos/ericf/handlebars-intl/subscribers","subscription_url":"https://api.github.com/repos/ericf/handlebars-intl/subscription","commits_url":"https://api.github.com/repos/ericf/handlebars-intl/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericf/handlebars-intl/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericf/handlebars-intl/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericf/handlebars-intl/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericf/handlebars-intl/contents/{+path}","compare_url":"https://api.github.com/repos/ericf/handlebars-intl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericf/handlebars-intl/merges","archive_url":"https://api.github.com/repos/ericf/handlebars-intl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericf/handlebars-intl/downloads","issues_url":"https://api.github.com/repos/ericf/handlebars-intl/issues{/number}","pulls_url":"https://api.github.com/repos/ericf/handlebars-intl/pulls{/number}","milestones_url":"https://api.github.com/repos/ericf/handlebars-intl/milestones{/number}","notifications_url":"https://api.github.com/repos/ericf/handlebars-intl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericf/handlebars-intl/labels{/name}","releases_url":"https://api.github.com/repos/ericf/handlebars-intl/releases{/id}","created_at":"2014-01-08T17:24:30Z","updated_at":"2015-03-10T06:01:24Z","pushed_at":"2015-03-19T20:34:21Z","git_url":"git://github.com/ericf/handlebars-intl.git","ssh_url":"git@github.com:ericf/handlebars-intl.git","clone_url":"https://github.com/ericf/handlebars-intl.git","svn_url":"https://github.com/ericf/handlebars-intl","homepage":null,"size":842,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"b41e8f262ecae90a5de256f97e8ca6fb7d637151","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":15267034,"name":"handlebars-intl","full_name":"yahoo/handlebars-intl","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/handlebars-intl","description":"Handlebars helpers for internationalization.","fork":false,"url":"https://api.github.com/repos/yahoo/handlebars-intl","forks_url":"https://api.github.com/repos/yahoo/handlebars-intl/forks","keys_url":"https://api.github.com/repos/yahoo/handlebars-intl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/handlebars-intl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/handlebars-intl/teams","hooks_url":"https://api.github.com/repos/yahoo/handlebars-intl/hooks","issue_events_url":"https://api.github.com/repos/yahoo/handlebars-intl/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/handlebars-intl/events","assignees_url":"https://api.github.com/repos/yahoo/handlebars-intl/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/handlebars-intl/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/handlebars-intl/tags","blobs_url":"https://api.github.com/repos/yahoo/handlebars-intl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/handlebars-intl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/handlebars-intl/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/handlebars-intl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/handlebars-intl/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/handlebars-intl/languages","stargazers_url":"https://api.github.com/repos/yahoo/handlebars-intl/stargazers","contributors_url":"https://api.github.com/repos/yahoo/handlebars-intl/contributors","subscribers_url":"https://api.github.com/repos/yahoo/handlebars-intl/subscribers","subscription_url":"https://api.github.com/repos/yahoo/handlebars-intl/subscription","commits_url":"https://api.github.com/repos/yahoo/handlebars-intl/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/handlebars-intl/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/handlebars-intl/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/handlebars-intl/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/handlebars-intl/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/handlebars-intl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/handlebars-intl/merges","archive_url":"https://api.github.com/repos/yahoo/handlebars-intl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/handlebars-intl/downloads","issues_url":"https://api.github.com/repos/yahoo/handlebars-intl/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/handlebars-intl/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/handlebars-intl/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/handlebars-intl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/handlebars-intl/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/handlebars-intl/releases{/id}","created_at":"2013-12-17T21:56:02Z","updated_at":"2015-03-18T19:45:25Z","pushed_at":"2015-03-19T20:38:11Z","git_url":"git://github.com/yahoo/handlebars-intl.git","ssh_url":"git@github.com:yahoo/handlebars-intl.git","clone_url":"https://github.com/yahoo/handlebars-intl.git","svn_url":"https://github.com/yahoo/handlebars-intl","homepage":"http://formatjs.io/handlebars/","size":1081,"stargazers_count":158,"watchers_count":158,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":6,"forks":17,"open_issues":6,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63"},"html":{"href":"https://github.com/yahoo/handlebars-intl/pull/63"},"issue":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/issues/63"},"comments":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/handlebars-intl/statuses/a1c63656c858e59590e88f33802f691252ab0f51"}}}}