{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments/36433278","id":36433278,"diff_hunk":"@@ -92,12 +107,13 @@ function ftTime(el) {\n \n \tif (!date) return;\n \n-\tvar interval = Math.round(((new Date()) - date) / 1000);\n-\tprinter.innerHTML = interval < (365 * 60 * 60 * 24) ? timeAgo(date, interval) : format(date, 'date');\n+\tprinter.innerHTML = ftTime(date);\n+\n \tel.title = format(date, 'datetime');\n \tel.setAttribute('data-o-date-js', '');\n }\n \n+\n function timeAgo (date, interval) {","path":"main.js","position":46,"original_position":46,"commit_id":"3fb795442ca29379ccafd87be9bcbcee6ae36cc4","original_commit_id":"3fb795442ca29379ccafd87be9bcbcee6ae36cc4","user":{"login":"AlbertoElias","id":913117,"avatar_url":"https://avatars.githubusercontent.com/u/913117?v=3","gravatar_id":"","url":"https://api.github.com/users/AlbertoElias","html_url":"https://github.com/AlbertoElias","followers_url":"https://api.github.com/users/AlbertoElias/followers","following_url":"https://api.github.com/users/AlbertoElias/following{/other_user}","gists_url":"https://api.github.com/users/AlbertoElias/gists{/gist_id}","starred_url":"https://api.github.com/users/AlbertoElias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlbertoElias/subscriptions","organizations_url":"https://api.github.com/users/AlbertoElias/orgs","repos_url":"https://api.github.com/users/AlbertoElias/repos","events_url":"https://api.github.com/users/AlbertoElias/events{/privacy}","received_events_url":"https://api.github.com/users/AlbertoElias/received_events","type":"User","site_admin":false},"body":"can't we just reduce the logic inside this function and move your logic in ftTime here or vice versa?","created_at":"2015-08-06T16:13:07Z","updated_at":"2015-08-06T16:13:07Z","html_url":"https://github.com/Financial-Times/o-date/pull/39#discussion_r36433278","pull_request_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments/36433278"},"html":{"href":"https://github.com/Financial-Times/o-date/pull/39#discussion_r36433278"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/o-date/pulls/39","id":41794132,"html_url":"https://github.com/Financial-Times/o-date/pull/39","diff_url":"https://github.com/Financial-Times/o-date/pull/39.diff","patch_url":"https://github.com/Financial-Times/o-date/pull/39.patch","issue_url":"https://api.github.com/repos/Financial-Times/o-date/issues/39","number":39,"state":"closed","locked":false,"title":"updated to show relative time only as far as yesterday","user":{"login":"wheresrhys","id":447559,"avatar_url":"https://avatars.githubusercontent.com/u/447559?v=3","gravatar_id":"","url":"https://api.github.com/users/wheresrhys","html_url":"https://github.com/wheresrhys","followers_url":"https://api.github.com/users/wheresrhys/followers","following_url":"https://api.github.com/users/wheresrhys/following{/other_user}","gists_url":"https://api.github.com/users/wheresrhys/gists{/gist_id}","starred_url":"https://api.github.com/users/wheresrhys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheresrhys/subscriptions","organizations_url":"https://api.github.com/users/wheresrhys/orgs","repos_url":"https://api.github.com/users/wheresrhys/repos","events_url":"https://api.github.com/users/wheresrhys/events{/privacy}","received_events_url":"https://api.github.com/users/wheresrhys/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-06T14:32:10Z","updated_at":"2015-08-06T16:13:07Z","closed_at":"2015-08-06T16:05:45Z","merged_at":"2015-08-06T16:05:45Z","merge_commit_sha":"a787ef337b5b38f0a34497a34ff6ab04d7a68c69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/o-date/issues/39/comments","statuses_url":"https://api.github.com/repos/Financial-Times/o-date/statuses/3fb795442ca29379ccafd87be9bcbcee6ae36cc4","head":{"label":"Financial-Times:yesterday","ref":"yesterday","sha":"3fb795442ca29379ccafd87be9bcbcee6ae36cc4","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":18879189,"name":"o-date","full_name":"Financial-Times/o-date","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/o-date","description":"Javascript utilities for formatting and updating dates in FT style","fork":false,"url":"https://api.github.com/repos/Financial-Times/o-date","forks_url":"https://api.github.com/repos/Financial-Times/o-date/forks","keys_url":"https://api.github.com/repos/Financial-Times/o-date/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/o-date/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/o-date/teams","hooks_url":"https://api.github.com/repos/Financial-Times/o-date/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/o-date/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/o-date/events","assignees_url":"https://api.github.com/repos/Financial-Times/o-date/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/o-date/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/o-date/tags","blobs_url":"https://api.github.com/repos/Financial-Times/o-date/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/o-date/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/o-date/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/o-date/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/o-date/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/o-date/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/o-date/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/o-date/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/o-date/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/o-date/subscription","commits_url":"https://api.github.com/repos/Financial-Times/o-date/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/o-date/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/o-date/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/o-date/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/o-date/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/o-date/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/o-date/merges","archive_url":"https://api.github.com/repos/Financial-Times/o-date/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/o-date/downloads","issues_url":"https://api.github.com/repos/Financial-Times/o-date/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/o-date/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/o-date/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/o-date/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/o-date/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/o-date/releases{/id}","created_at":"2014-04-17T13:26:23Z","updated_at":"2015-01-20T17:52:14Z","pushed_at":"2015-08-06T16:05:59Z","git_url":"git://github.com/Financial-Times/o-date.git","ssh_url":"git@github.com:Financial-Times/o-date.git","clone_url":"https://github.com/Financial-Times/o-date.git","svn_url":"https://github.com/Financial-Times/o-date","homepage":"registry.origami.ft.com/components/o-date","size":528,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"4d4be24a6783ea237f5f1bfe7ccd02072774bc96","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":18879189,"name":"o-date","full_name":"Financial-Times/o-date","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/o-date","description":"Javascript utilities for formatting and updating dates in FT style","fork":false,"url":"https://api.github.com/repos/Financial-Times/o-date","forks_url":"https://api.github.com/repos/Financial-Times/o-date/forks","keys_url":"https://api.github.com/repos/Financial-Times/o-date/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/o-date/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/o-date/teams","hooks_url":"https://api.github.com/repos/Financial-Times/o-date/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/o-date/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/o-date/events","assignees_url":"https://api.github.com/repos/Financial-Times/o-date/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/o-date/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/o-date/tags","blobs_url":"https://api.github.com/repos/Financial-Times/o-date/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/o-date/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/o-date/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/o-date/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/o-date/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/o-date/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/o-date/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/o-date/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/o-date/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/o-date/subscription","commits_url":"https://api.github.com/repos/Financial-Times/o-date/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/o-date/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/o-date/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/o-date/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/o-date/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/o-date/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/o-date/merges","archive_url":"https://api.github.com/repos/Financial-Times/o-date/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/o-date/downloads","issues_url":"https://api.github.com/repos/Financial-Times/o-date/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/o-date/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/o-date/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/o-date/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/o-date/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/o-date/releases{/id}","created_at":"2014-04-17T13:26:23Z","updated_at":"2015-01-20T17:52:14Z","pushed_at":"2015-08-06T16:05:59Z","git_url":"git://github.com/Financial-Times/o-date.git","ssh_url":"git@github.com:Financial-Times/o-date.git","clone_url":"https://github.com/Financial-Times/o-date.git","svn_url":"https://github.com/Financial-Times/o-date","homepage":"registry.origami.ft.com/components/o-date","size":528,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/39"},"html":{"href":"https://github.com/Financial-Times/o-date/pull/39"},"issue":{"href":"https://api.github.com/repos/Financial-Times/o-date/issues/39"},"comments":{"href":"https://api.github.com/repos/Financial-Times/o-date/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/o-date/statuses/3fb795442ca29379ccafd87be9bcbcee6ae36cc4"}}}}