{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/60860452","id":60860452,"diff_hunk":"@@ -200,33 +200,31 @@\n       textEl.classList.add('text');\n       titleEl.textContent = `${data.clientName} (${data.tabs.length})`;\n \n-      if (lastUpdateTimeAgo.year) {\n-        textEl.dataset.l10nId = 'fxsync-last-updated-more-than-a-year';\n-        textEl.dataset.l10nArgs = JSON.stringify({\n-          value: lastUpdateTimeAgo.year\n-        });\n-      } else if (lastUpdateTimeAgo.day) {\n-        textEl.dataset.l10nId = 'fxsync-last-updated-more-than-a-day';\n-        textEl.dataset.l10nArgs = JSON.stringify({\n-          value: lastUpdateTimeAgo.day\n-        });\n-      } else if (lastUpdateTimeAgo.hour) {\n-        textEl.dataset.l10nId = 'fxsync-last-updated-more-than-an-hour';\n-        textEl.dataset.l10nArgs = JSON.stringify({\n-          value: lastUpdateTimeAgo.hour\n-        });\n-      } else if (lastUpdateTimeAgo.minute) {\n-        textEl.dataset.l10nId = 'fxsync-last-updated-more-than-a-minute';\n-        textEl.dataset.l10nArgs = JSON.stringify({\n-          value: lastUpdateTimeAgo.minute\n-        });\n-      } else if (lastUpdateTimeAgo.second) {\n-        textEl.dataset.l10nId = 'fxsync-last-updated-more-than-a-second';\n-        textEl.dataset.l10nArgs = JSON.stringify({\n-          value: lastUpdateTimeAgo.second\n-        });\n+      let minute = Math.floor((Date.now() - data.timestamp) / (1000 * 60)),\n+          hour = minute ? Math.floor(minute / 60) : 0,\n+          day = hour ? Math.floor(hour / 24) : 0,\n+          year = day ? Math.floor(day / 365) : 0,\n+          timeUnit = '';\n+\n+      if (year) {\n+        timeUnit = 'year';\n+      } else if (day) {\n+        timeUnit = 'day';\n+      } else if (hour) {\n+        timeUnit = 'hour';\n+      } else {\n+        timeUnit = 'minute';\n       }\n \n+      let rtf = new mozIntl.RelativeTimeFormat(navigator.languages, {\n+        unit: timeUnit\n+      });","path":"tv_apps/browser/js/sync/tabList.js","position":null,"original_position":64,"commit_id":"c7708dd89a7740538c0b3a1e8dfcaa452dee65b0","original_commit_id":"4c451ed7e8e7f6f2ab94393eba71b62e0e873b9d","user":{"login":"danhuang1202","id":4784004,"avatar_url":"https://avatars.githubusercontent.com/u/4784004?v=3","gravatar_id":"","url":"https://api.github.com/users/danhuang1202","html_url":"https://github.com/danhuang1202","followers_url":"https://api.github.com/users/danhuang1202/followers","following_url":"https://api.github.com/users/danhuang1202/following{/other_user}","gists_url":"https://api.github.com/users/danhuang1202/gists{/gist_id}","starred_url":"https://api.github.com/users/danhuang1202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhuang1202/subscriptions","organizations_url":"https://api.github.com/users/danhuang1202/orgs","repos_url":"https://api.github.com/users/danhuang1202/repos","events_url":"https://api.github.com/users/danhuang1202/events{/privacy}","received_events_url":"https://api.github.com/users/danhuang1202/received_events","type":"User","site_admin":false},"body":"Cool! It's really helpful!","created_at":"2016-04-25T03:40:29Z","updated_at":"2016-04-25T03:40:29Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/34257#discussion_r60860452","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/60860452"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/34257#discussion_r60860452"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257","id":67470067,"html_url":"https://github.com/mozilla-b2g/gaia/pull/34257","diff_url":"https://github.com/mozilla-b2g/gaia/pull/34257.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/34257.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/34257","number":34257,"state":"open","locked":false,"title":"Bug 1264883 - use mozIntl to update the time information in sync tab.…","user":{"login":"danhuang1202","id":4784004,"avatar_url":"https://avatars.githubusercontent.com/u/4784004?v=3","gravatar_id":"","url":"https://api.github.com/users/danhuang1202","html_url":"https://github.com/danhuang1202","followers_url":"https://api.github.com/users/danhuang1202/followers","following_url":"https://api.github.com/users/danhuang1202/following{/other_user}","gists_url":"https://api.github.com/users/danhuang1202/gists{/gist_id}","starred_url":"https://api.github.com/users/danhuang1202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhuang1202/subscriptions","organizations_url":"https://api.github.com/users/danhuang1202/orgs","repos_url":"https://api.github.com/users/danhuang1202/repos","events_url":"https://api.github.com/users/danhuang1202/events{/privacy}","received_events_url":"https://api.github.com/users/danhuang1202/received_events","type":"User","site_admin":false},"body":"… r=zibi","created_at":"2016-04-22T07:30:43Z","updated_at":"2016-04-25T03:40:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0a6541aa0b0a667c4cc8e0bd32839267ee031d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/34257/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/c7708dd89a7740538c0b3a1e8dfcaa452dee65b0","head":{"label":"danhuang1202:bug1264883_sync_tab_list_time_string_not_correct","ref":"bug1264883_sync_tab_list_time_string_not_correct","sha":"c7708dd89a7740538c0b3a1e8dfcaa452dee65b0","user":{"login":"danhuang1202","id":4784004,"avatar_url":"https://avatars.githubusercontent.com/u/4784004?v=3","gravatar_id":"","url":"https://api.github.com/users/danhuang1202","html_url":"https://github.com/danhuang1202","followers_url":"https://api.github.com/users/danhuang1202/followers","following_url":"https://api.github.com/users/danhuang1202/following{/other_user}","gists_url":"https://api.github.com/users/danhuang1202/gists{/gist_id}","starred_url":"https://api.github.com/users/danhuang1202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhuang1202/subscriptions","organizations_url":"https://api.github.com/users/danhuang1202/orgs","repos_url":"https://api.github.com/users/danhuang1202/repos","events_url":"https://api.github.com/users/danhuang1202/events{/privacy}","received_events_url":"https://api.github.com/users/danhuang1202/received_events","type":"User","site_admin":false},"repo":{"id":40878236,"name":"gaia","full_name":"danhuang1202/gaia","owner":{"login":"danhuang1202","id":4784004,"avatar_url":"https://avatars.githubusercontent.com/u/4784004?v=3","gravatar_id":"","url":"https://api.github.com/users/danhuang1202","html_url":"https://github.com/danhuang1202","followers_url":"https://api.github.com/users/danhuang1202/followers","following_url":"https://api.github.com/users/danhuang1202/following{/other_user}","gists_url":"https://api.github.com/users/danhuang1202/gists{/gist_id}","starred_url":"https://api.github.com/users/danhuang1202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danhuang1202/subscriptions","organizations_url":"https://api.github.com/users/danhuang1202/orgs","repos_url":"https://api.github.com/users/danhuang1202/repos","events_url":"https://api.github.com/users/danhuang1202/events{/privacy}","received_events_url":"https://api.github.com/users/danhuang1202/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danhuang1202/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":true,"url":"https://api.github.com/repos/danhuang1202/gaia","forks_url":"https://api.github.com/repos/danhuang1202/gaia/forks","keys_url":"https://api.github.com/repos/danhuang1202/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danhuang1202/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danhuang1202/gaia/teams","hooks_url":"https://api.github.com/repos/danhuang1202/gaia/hooks","issue_events_url":"https://api.github.com/repos/danhuang1202/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/danhuang1202/gaia/events","assignees_url":"https://api.github.com/repos/danhuang1202/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/danhuang1202/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/danhuang1202/gaia/tags","blobs_url":"https://api.github.com/repos/danhuang1202/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danhuang1202/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danhuang1202/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/danhuang1202/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danhuang1202/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/danhuang1202/gaia/languages","stargazers_url":"https://api.github.com/repos/danhuang1202/gaia/stargazers","contributors_url":"https://api.github.com/repos/danhuang1202/gaia/contributors","subscribers_url":"https://api.github.com/repos/danhuang1202/gaia/subscribers","subscription_url":"https://api.github.com/repos/danhuang1202/gaia/subscription","commits_url":"https://api.github.com/repos/danhuang1202/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/danhuang1202/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/danhuang1202/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/danhuang1202/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/danhuang1202/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/danhuang1202/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danhuang1202/gaia/merges","archive_url":"https://api.github.com/repos/danhuang1202/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danhuang1202/gaia/downloads","issues_url":"https://api.github.com/repos/danhuang1202/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/danhuang1202/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/danhuang1202/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/danhuang1202/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danhuang1202/gaia/labels{/name}","releases_url":"https://api.github.com/repos/danhuang1202/gaia/releases{/id}","deployments_url":"https://api.github.com/repos/danhuang1202/gaia/deployments","created_at":"2015-08-17T08:38:52Z","updated_at":"2016-01-13T08:50:36Z","pushed_at":"2016-04-25T03:38:32Z","git_url":"git://github.com/danhuang1202/gaia.git","ssh_url":"git@github.com:danhuang1202/gaia.git","clone_url":"https://github.com/danhuang1202/gaia.git","svn_url":"https://github.com/danhuang1202/gaia","homepage":"https://wiki.mozilla.org/B2G","size":985913,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"mozilla-b2g:master","ref":"master","sha":"992054ba4ae1c71715ac5f18d7cbed17d0412f81","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-b2g/gaia/deployments","created_at":"2011-09-03T01:38:46Z","updated_at":"2016-04-21T03:44:02Z","pushed_at":"2016-04-25T03:38:34Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1208176,"stargazers_count":2039,"watchers_count":2039,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2558,"mirror_url":null,"open_issues_count":1310,"forks":2558,"open_issues":1310,"watchers":2039,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/34257"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/34257"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/34257/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/34257/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/c7708dd89a7740538c0b3a1e8dfcaa452dee65b0"}}}}