{"action":"created","comment":{"url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/comments/72023381","id":72023381,"diff_hunk":"@@ -0,0 +1,83 @@\n+const chai = require('chai');\n+const expect = chai.expect;\n+const dateUtils = require('../../app/lib/dateUtils.js');\n+\n+describe('dateUtils', () => {\n+  describe('timeInRange', () => {\n+    describe('GMT date', () => {\n+      it('should return true if time is in range', () => {\n+        const inRange = dateUtils.timeInRange(\n+          new Date('December 13, 2014 09:05:00'),\n+          '09:00',\n+          '17:30');\n+        expect(inRange).to.equal(true);\n+      });\n+      it('should return false if time is below range', () => {\n+        const inRange = dateUtils.timeInRange(\n+          new Date('December 13, 2014 08:55:00'),\n+          '09:00',\n+          '17:30');\n+        expect(inRange).to.equal(false);\n+      });\n+    });\n+    describe('BST date', () => {\n+      it('should return true if time is in range', () => {\n+        const inRange = dateUtils.timeInRange(\n+          new Date('October 13, 2014 09:05:00'),\n+          '09:00',\n+          '17:30');\n+        expect(inRange).to.equal(true);\n+      });\n+      it('should return false if time is below the range (BST)', () => {\n+        const inRange = dateUtils.timeInRange(\n+          new Date('October 13, 2014 08:55:00'),\n+          '09:00',\n+          '17:30');\n+        expect(inRange).to.equal(false);\n+      });\n+      it('should return false if time is above the range (BST)', () => {\n+        const inRange = dateUtils.timeInRange(\n+          new Date('October 13, 2014 18:30:00'),\n+          '09:00',\n+          '17:30');\n+        expect(inRange).to.equal(false);\n+      });\n+    });\n+    it('should handle an end time of midnight or later', () => {\n+      // Range of times to check nothing bad happens with BST adjustments\n+      ['00:00', '01:00', '02:30'].forEach((endTime) => {\n+        expect(dateUtils.timeInRange(\n+          new Date('October 13, 2014 18:30:00'),\n+          '08:00',\n+          endTime))\n+          .to.equal(true);\n+      });\n+    });\n+    it('should handle opening times which span transitions to/from BST');\n+  });\n+  describe('getDayName', () => {","path":"test/unit/dateUtils.js","position":58,"original_position":58,"commit_id":"56e24fc864e3c8d11959f57979d9cba5bcd5daf9","original_commit_id":"56e24fc864e3c8d11959f57979d9cba5bcd5daf9","user":{"login":"st3v3nhunt","id":639706,"avatar_url":"https://avatars.githubusercontent.com/u/639706?v=3","gravatar_id":"","url":"https://api.github.com/users/st3v3nhunt","html_url":"https://github.com/st3v3nhunt","followers_url":"https://api.github.com/users/st3v3nhunt/followers","following_url":"https://api.github.com/users/st3v3nhunt/following{/other_user}","gists_url":"https://api.github.com/users/st3v3nhunt/gists{/gist_id}","starred_url":"https://api.github.com/users/st3v3nhunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/st3v3nhunt/subscriptions","organizations_url":"https://api.github.com/users/st3v3nhunt/orgs","repos_url":"https://api.github.com/users/st3v3nhunt/repos","events_url":"https://api.github.com/users/st3v3nhunt/events{/privacy}","received_events_url":"https://api.github.com/users/st3v3nhunt/received_events","type":"User","site_admin":false},"body":"Is this waiting to be deleted?","created_at":"2016-07-25T08:08:31Z","updated_at":"2016-07-25T08:08:31Z","html_url":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11#discussion_r72023381","pull_request_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/comments/72023381"},"html":{"href":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11#discussion_r72023381"},"pull_request":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11","id":78638339,"html_url":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11","diff_url":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11.diff","patch_url":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11.patch","issue_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/11","number":11,"state":"open","locked":false,"title":":watch: Add open now status for pharmacy","user":{"login":"neilbmclaughlin","id":212582,"avatar_url":"https://avatars.githubusercontent.com/u/212582?v=3","gravatar_id":"","url":"https://api.github.com/users/neilbmclaughlin","html_url":"https://github.com/neilbmclaughlin","followers_url":"https://api.github.com/users/neilbmclaughlin/followers","following_url":"https://api.github.com/users/neilbmclaughlin/following{/other_user}","gists_url":"https://api.github.com/users/neilbmclaughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/neilbmclaughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilbmclaughlin/subscriptions","organizations_url":"https://api.github.com/users/neilbmclaughlin/orgs","repos_url":"https://api.github.com/users/neilbmclaughlin/repos","events_url":"https://api.github.com/users/neilbmclaughlin/events{/privacy}","received_events_url":"https://api.github.com/users/neilbmclaughlin/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-25T07:41:36Z","updated_at":"2016-07-25T08:08:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfc5283062fbac8d40c0914c0ecf51b9be525e1f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11/commits","review_comments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11/comments","review_comment_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/11/comments","statuses_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/statuses/56e24fc864e3c8d11959f57979d9cba5bcd5daf9","head":{"label":"nhsalpha:feature/open-now","ref":"feature/open-now","sha":"56e24fc864e3c8d11959f57979d9cba5bcd5daf9","user":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"repo":{"id":63855497,"name":"connecting-to-services-hack-day","full_name":"nhsalpha/connecting-to-services-hack-day","owner":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nhsalpha/connecting-to-services-hack-day","description":"Hack day repo for connecting to services","fork":false,"url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day","forks_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/forks","keys_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/teams","hooks_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/hooks","issue_events_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/events{/number}","events_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/events","assignees_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/assignees{/user}","branches_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/branches{/branch}","tags_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/tags","blobs_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/statuses/{sha}","languages_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/languages","stargazers_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/stargazers","contributors_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/contributors","subscribers_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/subscribers","subscription_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/subscription","commits_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/contents/{+path}","compare_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/merges","archive_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/downloads","issues_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues{/number}","pulls_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls{/number}","milestones_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/milestones{/number}","notifications_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/labels{/name}","releases_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/releases{/id}","deployments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/deployments","created_at":"2016-07-21T09:22:10Z","updated_at":"2016-07-21T18:19:34Z","pushed_at":"2016-07-25T07:41:36Z","git_url":"git://github.com/nhsalpha/connecting-to-services-hack-day.git","ssh_url":"git@github.com:nhsalpha/connecting-to-services-hack-day.git","clone_url":"https://github.com/nhsalpha/connecting-to-services-hack-day.git","svn_url":"https://github.com/nhsalpha/connecting-to-services-hack-day","homepage":null,"size":398,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"nhsalpha:master","ref":"master","sha":"5ead9b1fa1d05f5baf089cb4a33ab2bf481cb468","user":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"repo":{"id":63855497,"name":"connecting-to-services-hack-day","full_name":"nhsalpha/connecting-to-services-hack-day","owner":{"login":"nhsalpha","id":12557899,"avatar_url":"https://avatars.githubusercontent.com/u/12557899?v=3","gravatar_id":"","url":"https://api.github.com/users/nhsalpha","html_url":"https://github.com/nhsalpha","followers_url":"https://api.github.com/users/nhsalpha/followers","following_url":"https://api.github.com/users/nhsalpha/following{/other_user}","gists_url":"https://api.github.com/users/nhsalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/nhsalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhsalpha/subscriptions","organizations_url":"https://api.github.com/users/nhsalpha/orgs","repos_url":"https://api.github.com/users/nhsalpha/repos","events_url":"https://api.github.com/users/nhsalpha/events{/privacy}","received_events_url":"https://api.github.com/users/nhsalpha/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nhsalpha/connecting-to-services-hack-day","description":"Hack day repo for connecting to services","fork":false,"url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day","forks_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/forks","keys_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/teams","hooks_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/hooks","issue_events_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/events{/number}","events_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/events","assignees_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/assignees{/user}","branches_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/branches{/branch}","tags_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/tags","blobs_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/statuses/{sha}","languages_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/languages","stargazers_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/stargazers","contributors_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/contributors","subscribers_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/subscribers","subscription_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/subscription","commits_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/contents/{+path}","compare_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/merges","archive_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/downloads","issues_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues{/number}","pulls_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls{/number}","milestones_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/milestones{/number}","notifications_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/labels{/name}","releases_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/releases{/id}","deployments_url":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/deployments","created_at":"2016-07-21T09:22:10Z","updated_at":"2016-07-21T18:19:34Z","pushed_at":"2016-07-25T07:41:36Z","git_url":"git://github.com/nhsalpha/connecting-to-services-hack-day.git","ssh_url":"git@github.com:nhsalpha/connecting-to-services-hack-day.git","clone_url":"https://github.com/nhsalpha/connecting-to-services-hack-day.git","svn_url":"https://github.com/nhsalpha/connecting-to-services-hack-day","homepage":null,"size":398,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11"},"html":{"href":"https://github.com/nhsalpha/connecting-to-services-hack-day/pull/11"},"issue":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/11"},"comments":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/nhsalpha/connecting-to-services-hack-day/statuses/56e24fc864e3c8d11959f57979d9cba5bcd5daf9"}}}}
{"actor":{"display_login":"st3v3nhunt"}}