{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments/68595902","id":68595902,"diff_hunk":"@@ -1,6 +1,7 @@\n const now = new Date();\n const today = new Date();\n today.setHours(now.getHours() - 6);\n-document.querySelector('time:not([datetime])').setAttribute('datetime', today.toISOString());\n+const dates = document.querySelectorAll('time:not([datetime])');\n+dates.forEach(function(dateElem){dateElem.setAttribute('datetime', today.toISOString())});","path":"demos/src/declarative.js","position":6,"original_position":6,"commit_id":"80e6473bc1570cd6af4f98ef8738e3cbb0dcdc9f","original_commit_id":"80e6473bc1570cd6af4f98ef8738e3cbb0dcdc9f","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":"good place for an arrow function, not very readable like this","created_at":"2016-06-27T15:21:34Z","updated_at":"2016-06-27T15:21:34Z","html_url":"https://github.com/Financial-Times/o-date/pull/56#discussion_r68595902","pull_request_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/comments/68595902"},"html":{"href":"https://github.com/Financial-Times/o-date/pull/56#discussion_r68595902"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/o-date/pulls/56","id":75319828,"html_url":"https://github.com/Financial-Times/o-date/pull/56","diff_url":"https://github.com/Financial-Times/o-date/pull/56.diff","patch_url":"https://github.com/Financial-Times/o-date/pull/56.patch","issue_url":"https://api.github.com/repos/Financial-Times/o-date/issues/56","number":56,"state":"open","locked":false,"title":"Add new formatting function","user":{"login":"alicebartlett","id":68009,"avatar_url":"https://avatars.githubusercontent.com/u/68009?v=3","gravatar_id":"","url":"https://api.github.com/users/alicebartlett","html_url":"https://github.com/alicebartlett","followers_url":"https://api.github.com/users/alicebartlett/followers","following_url":"https://api.github.com/users/alicebartlett/following{/other_user}","gists_url":"https://api.github.com/users/alicebartlett/gists{/gist_id}","starred_url":"https://api.github.com/users/alicebartlett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alicebartlett/subscriptions","organizations_url":"https://api.github.com/users/alicebartlett/orgs","repos_url":"https://api.github.com/users/alicebartlett/repos","events_url":"https://api.github.com/users/alicebartlett/events{/privacy}","received_events_url":"https://api.github.com/users/alicebartlett/received_events","type":"User","site_admin":false},"body":"Next have a need for a formatting option that displays the most appropriate of:\r\n{today|yesterday|''}\r\n\r\nThis commit adds a formatting function which can be invoked by adding the\r\n`data-o-date-format=today-or-yesterday-or-nothing` data attribute to a date.\r\n\r\nThis way of solving this problem demonstrates a way to add further formatting\r\nhelpers should we need them.\r\n\r\nThis commit:\r\n- Adds the helper, ODate.asTodayOrYesterdayOrNothing\r\n- Adds some tests for ODate.asTodayOrYesterdayOrNothing\r\n- Updates the demos with this option\r\n- Adds a dependency to jasmine core so tests will run\r\n\r\n@AlbertoElias what do you think about this as a general approach?","created_at":"2016-06-27T14:23:11Z","updated_at":"2016-06-27T15:21:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4adbb849d63774410ebb43d3d2e04f29dd761d7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/56/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/o-date/pulls/56/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/56/comments","statuses_url":"https://api.github.com/repos/Financial-Times/o-date/statuses/80e6473bc1570cd6af4f98ef8738e3cbb0dcdc9f","head":{"label":"Financial-Times:add-today-or-yesterday","ref":"add-today-or-yesterday","sha":"80e6473bc1570cd6af4f98ef8738e3cbb0dcdc9f","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}","deployments_url":"https://api.github.com/repos/Financial-Times/o-date/deployments","created_at":"2014-04-17T13:26:23Z","updated_at":"2016-01-12T12:09:18Z","pushed_at":"2016-06-27T15:18:15Z","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":109,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"dc0053cb785203c10865f69afcd6231ce4a44066","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}","deployments_url":"https://api.github.com/repos/Financial-Times/o-date/deployments","created_at":"2014-04-17T13:26:23Z","updated_at":"2016-01-12T12:09:18Z","pushed_at":"2016-06-27T15:18:15Z","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":109,"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":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/56"},"html":{"href":"https://github.com/Financial-Times/o-date/pull/56"},"issue":{"href":"https://api.github.com/repos/Financial-Times/o-date/issues/56"},"comments":{"href":"https://api.github.com/repos/Financial-Times/o-date/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/o-date/pulls/56/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/56/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/o-date/statuses/80e6473bc1570cd6af4f98ef8738e3cbb0dcdc9f"}}}}
{"actor":{"display_login":"AlbertoElias"}}