{"action":"created","comment":{"url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/comments/210548874","pull_request_review_id":146758550,"id":210548874,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDU0ODg3NA==","diff_hunk":"@@ -127,7 +167,46 @@ export default class DatePickerContext extends Component {\n     const [ startDate, endDate ] = orderDates(selectedStartDate, selectedEndDate);\n     const [ earliestDate, latestDate ] = orderDates(earliestSelectableDate, latestSelectableDate);\n \n-    const isDoubeView = view === 'double';\n+    const isDoubleView = view === 'double';\n+    const showRangeSelection = rangeSelect && rangeSelections && rangeSelections.length;\n+\n+    const rangeSelection = showRangeSelection && (isDoubleView ? (","path":"packages/axiom-components/src/DatePicker/DatePickerContext.js","position":94,"original_position":94,"commit_id":"ca4e6ee7da7174df1305257d7946002cb1783050","original_commit_id":"ca4e6ee7da7174df1305257d7946002cb1783050","user":{"login":"lpoulter","id":3940567,"node_id":"MDQ6VXNlcjM5NDA1Njc=","avatar_url":"https://avatars2.githubusercontent.com/u/3940567?v=4","gravatar_id":"","url":"https://api.github.com/users/lpoulter","html_url":"https://github.com/lpoulter","followers_url":"https://api.github.com/users/lpoulter/followers","following_url":"https://api.github.com/users/lpoulter/following{/other_user}","gists_url":"https://api.github.com/users/lpoulter/gists{/gist_id}","starred_url":"https://api.github.com/users/lpoulter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpoulter/subscriptions","organizations_url":"https://api.github.com/users/lpoulter/orgs","repos_url":"https://api.github.com/users/lpoulter/repos","events_url":"https://api.github.com/users/lpoulter/events{/privacy}","received_events_url":"https://api.github.com/users/lpoulter/received_events","type":"User","site_admin":false},"body":"Perhaps this template could be simplified if we had a `DatePickerView` component that rendered one or two DatePickerHeaderControl/DatePickerViewMonth pairs based on a double prop.","created_at":"2018-08-16T10:34:24Z","updated_at":"2018-08-16T10:36:10Z","html_url":"https://github.com/BrandwatchLtd/axiom/pull/614#discussion_r210548874","pull_request_url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/comments/210548874"},"html":{"href":"https://github.com/BrandwatchLtd/axiom/pull/614#discussion_r210548874"},"pull_request":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614"}},"in_reply_to_id":210548336},"pull_request":{"url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614","id":199448893,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NDQ4ODkz","html_url":"https://github.com/BrandwatchLtd/axiom/pull/614","diff_url":"https://github.com/BrandwatchLtd/axiom/pull/614.diff","patch_url":"https://github.com/BrandwatchLtd/axiom/pull/614.patch","issue_url":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/614","number":614,"state":"open","locked":false,"title":"feat(DatePicker): add quick selection","user":{"login":"tomru","id":111471,"node_id":"MDQ6VXNlcjExMTQ3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/111471?v=4","gravatar_id":"","url":"https://api.github.com/users/tomru","html_url":"https://github.com/tomru","followers_url":"https://api.github.com/users/tomru/followers","following_url":"https://api.github.com/users/tomru/following{/other_user}","gists_url":"https://api.github.com/users/tomru/gists{/gist_id}","starred_url":"https://api.github.com/users/tomru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomru/subscriptions","organizations_url":"https://api.github.com/users/tomru/orgs","repos_url":"https://api.github.com/users/tomru/repos","events_url":"https://api.github.com/users/tomru/events{/privacy}","received_events_url":"https://api.github.com/users/tomru/received_events","type":"User","site_admin":false},"body":"## Adds quick selection ranges to the Date Picker.\r\n\r\nThe DatePicker can now offer _quick selections_ for ranges to the user.\r\n\r\nThese quick selections can be specified by setting the prop `rangeQuickSelections` in the form of e.g. \r\n```js\r\n[\r\n  {\r\n    label: 'Today',\r\n    range: 'P1D',\r\n  },\r\n  {\r\n    label: '7D',\r\n    range: 'P7D',\r\n  },\r\n  {\r\n    label: '14D',\r\n    range: 'P14D',\r\n  },\r\n  {\r\n    label: '1M',\r\n    range: 'P1M',\r\n  },\r\n  {\r\n    label: '2M',\r\n    range: 'P2M',\r\n  },\r\n]\r\n```\r\n\r\nThe quick selection ranges are only shown if the component has\r\n* `rangeSelect`\r\n* `rangeQuickSelections` not set to `null` or an empty array.\r\n\r\nWhen the user clicks on of these the `onSelect` callback is called with the `range` of the quick selection clicked.  It's then up to the application to convert the `range` into `startDate` and `endDate` and update these properties on the `DatePicker` so that the clicked range is selected.\r\n\r\nThis allows us to keep the application logic outside of axiom and keep the implementation completely agnostic of what these ranges mean in an application. (i.e. does 7D means 7*24h ago until now or start of the day 7 days ago until now....)\r\n\r\n![single](https://user-images.githubusercontent.com/111471/44025304-088c9110-9ef0-11e8-8ed7-8e59979ee50d.gif)\r\n\r\n![double](https://user-images.githubusercontent.com/111471/44025346-2d3b712a-9ef0-11e8-9a96-3eceb1783941.gif)\r\n\r\n\r\n~~[Netlify Link](https://5b71551b4ed62f6d0c396c7e--youthful-albattani-41ebb2.netlify.com/docs/packages/axiom-components/date-picker)~~\r\n~~[Netlify Link](https://5b72854dc96592106b141531--youthful-albattani-41ebb2.netlify.com/docs/packages/axiom-components/date-picker)~~\r\n[Netlify Link](https://5b728f081f12b744b73c03d0--youthful-albattani-41ebb2.netlify.com/docs/packages/axiom-components/date-picker/)","created_at":"2018-07-05T12:06:59Z","updated_at":"2018-08-16T10:36:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55ff6dcf31b43ecff40137ac34f3de545119246b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":550498093,"node_id":"MDU6TGFiZWw1NTA0OTgwOTM=","url":"https://api.github.com/repos/BrandwatchLtd/axiom/labels/:art:%20%20Design%20Review%20Needed","name":":art:  Design Review Needed","color":"bfdadc","default":false},{"id":550561808,"node_id":"MDU6TGFiZWw1NTA1NjE4MDg=","url":"https://api.github.com/repos/BrandwatchLtd/axiom/labels/:woman_technologist:%20%201st%20Code%20Review%20Needed","name":":woman_technologist:  1st Code Review Needed","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614/commits","review_comments_url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614/comments","review_comment_url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/614/comments","statuses_url":"https://api.github.com/repos/BrandwatchLtd/axiom/statuses/ca4e6ee7da7174df1305257d7946002cb1783050","head":{"label":"tomru:ax-20-date-picker-quick-select","ref":"ax-20-date-picker-quick-select","sha":"ca4e6ee7da7174df1305257d7946002cb1783050","user":{"login":"tomru","id":111471,"node_id":"MDQ6VXNlcjExMTQ3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/111471?v=4","gravatar_id":"","url":"https://api.github.com/users/tomru","html_url":"https://github.com/tomru","followers_url":"https://api.github.com/users/tomru/followers","following_url":"https://api.github.com/users/tomru/following{/other_user}","gists_url":"https://api.github.com/users/tomru/gists{/gist_id}","starred_url":"https://api.github.com/users/tomru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomru/subscriptions","organizations_url":"https://api.github.com/users/tomru/orgs","repos_url":"https://api.github.com/users/tomru/repos","events_url":"https://api.github.com/users/tomru/events{/privacy}","received_events_url":"https://api.github.com/users/tomru/received_events","type":"User","site_admin":false},"repo":{"id":101401680,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE0MDE2ODA=","name":"axiom","full_name":"tomru/axiom","owner":{"login":"tomru","id":111471,"node_id":"MDQ6VXNlcjExMTQ3MQ==","avatar_url":"https://avatars3.githubusercontent.com/u/111471?v=4","gravatar_id":"","url":"https://api.github.com/users/tomru","html_url":"https://github.com/tomru","followers_url":"https://api.github.com/users/tomru/followers","following_url":"https://api.github.com/users/tomru/following{/other_user}","gists_url":"https://api.github.com/users/tomru/gists{/gist_id}","starred_url":"https://api.github.com/users/tomru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomru/subscriptions","organizations_url":"https://api.github.com/users/tomru/orgs","repos_url":"https://api.github.com/users/tomru/repos","events_url":"https://api.github.com/users/tomru/events{/privacy}","received_events_url":"https://api.github.com/users/tomru/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomru/axiom","description":"🍥 Axiom - Pattern Library","fork":true,"url":"https://api.github.com/repos/tomru/axiom","forks_url":"https://api.github.com/repos/tomru/axiom/forks","keys_url":"https://api.github.com/repos/tomru/axiom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomru/axiom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomru/axiom/teams","hooks_url":"https://api.github.com/repos/tomru/axiom/hooks","issue_events_url":"https://api.github.com/repos/tomru/axiom/issues/events{/number}","events_url":"https://api.github.com/repos/tomru/axiom/events","assignees_url":"https://api.github.com/repos/tomru/axiom/assignees{/user}","branches_url":"https://api.github.com/repos/tomru/axiom/branches{/branch}","tags_url":"https://api.github.com/repos/tomru/axiom/tags","blobs_url":"https://api.github.com/repos/tomru/axiom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomru/axiom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomru/axiom/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomru/axiom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomru/axiom/statuses/{sha}","languages_url":"https://api.github.com/repos/tomru/axiom/languages","stargazers_url":"https://api.github.com/repos/tomru/axiom/stargazers","contributors_url":"https://api.github.com/repos/tomru/axiom/contributors","subscribers_url":"https://api.github.com/repos/tomru/axiom/subscribers","subscription_url":"https://api.github.com/repos/tomru/axiom/subscription","commits_url":"https://api.github.com/repos/tomru/axiom/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomru/axiom/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomru/axiom/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomru/axiom/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomru/axiom/contents/{+path}","compare_url":"https://api.github.com/repos/tomru/axiom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomru/axiom/merges","archive_url":"https://api.github.com/repos/tomru/axiom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomru/axiom/downloads","issues_url":"https://api.github.com/repos/tomru/axiom/issues{/number}","pulls_url":"https://api.github.com/repos/tomru/axiom/pulls{/number}","milestones_url":"https://api.github.com/repos/tomru/axiom/milestones{/number}","notifications_url":"https://api.github.com/repos/tomru/axiom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomru/axiom/labels{/name}","releases_url":"https://api.github.com/repos/tomru/axiom/releases{/id}","deployments_url":"https://api.github.com/repos/tomru/axiom/deployments","created_at":"2017-08-25T12:28:56Z","updated_at":"2018-07-03T21:14:09Z","pushed_at":"2018-08-16T09:25:38Z","git_url":"git://github.com/tomru/axiom.git","ssh_url":"git@github.com:tomru/axiom.git","clone_url":"https://github.com/tomru/axiom.git","svn_url":"https://github.com/tomru/axiom","homepage":"https://brandwatchltd.github.io/axiom","size":29400,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BrandwatchLtd:master","ref":"master","sha":"f0265ede3078a8f27530a52a84993855354e2ad0","user":{"login":"BrandwatchLtd","id":807036,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNzAzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/807036?v=4","gravatar_id":"","url":"https://api.github.com/users/BrandwatchLtd","html_url":"https://github.com/BrandwatchLtd","followers_url":"https://api.github.com/users/BrandwatchLtd/followers","following_url":"https://api.github.com/users/BrandwatchLtd/following{/other_user}","gists_url":"https://api.github.com/users/BrandwatchLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandwatchLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandwatchLtd/subscriptions","organizations_url":"https://api.github.com/users/BrandwatchLtd/orgs","repos_url":"https://api.github.com/users/BrandwatchLtd/repos","events_url":"https://api.github.com/users/BrandwatchLtd/events{/privacy}","received_events_url":"https://api.github.com/users/BrandwatchLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":56243759,"node_id":"MDEwOlJlcG9zaXRvcnk1NjI0Mzc1OQ==","name":"axiom","full_name":"BrandwatchLtd/axiom","owner":{"login":"BrandwatchLtd","id":807036,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNzAzNg==","avatar_url":"https://avatars0.githubusercontent.com/u/807036?v=4","gravatar_id":"","url":"https://api.github.com/users/BrandwatchLtd","html_url":"https://github.com/BrandwatchLtd","followers_url":"https://api.github.com/users/BrandwatchLtd/followers","following_url":"https://api.github.com/users/BrandwatchLtd/following{/other_user}","gists_url":"https://api.github.com/users/BrandwatchLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandwatchLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandwatchLtd/subscriptions","organizations_url":"https://api.github.com/users/BrandwatchLtd/orgs","repos_url":"https://api.github.com/users/BrandwatchLtd/repos","events_url":"https://api.github.com/users/BrandwatchLtd/events{/privacy}","received_events_url":"https://api.github.com/users/BrandwatchLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BrandwatchLtd/axiom","description":"Axiom - Brandwatch design system and React pattern library","fork":false,"url":"https://api.github.com/repos/BrandwatchLtd/axiom","forks_url":"https://api.github.com/repos/BrandwatchLtd/axiom/forks","keys_url":"https://api.github.com/repos/BrandwatchLtd/axiom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrandwatchLtd/axiom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrandwatchLtd/axiom/teams","hooks_url":"https://api.github.com/repos/BrandwatchLtd/axiom/hooks","issue_events_url":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/events{/number}","events_url":"https://api.github.com/repos/BrandwatchLtd/axiom/events","assignees_url":"https://api.github.com/repos/BrandwatchLtd/axiom/assignees{/user}","branches_url":"https://api.github.com/repos/BrandwatchLtd/axiom/branches{/branch}","tags_url":"https://api.github.com/repos/BrandwatchLtd/axiom/tags","blobs_url":"https://api.github.com/repos/BrandwatchLtd/axiom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrandwatchLtd/axiom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrandwatchLtd/axiom/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrandwatchLtd/axiom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrandwatchLtd/axiom/statuses/{sha}","languages_url":"https://api.github.com/repos/BrandwatchLtd/axiom/languages","stargazers_url":"https://api.github.com/repos/BrandwatchLtd/axiom/stargazers","contributors_url":"https://api.github.com/repos/BrandwatchLtd/axiom/contributors","subscribers_url":"https://api.github.com/repos/BrandwatchLtd/axiom/subscribers","subscription_url":"https://api.github.com/repos/BrandwatchLtd/axiom/subscription","commits_url":"https://api.github.com/repos/BrandwatchLtd/axiom/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrandwatchLtd/axiom/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrandwatchLtd/axiom/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrandwatchLtd/axiom/contents/{+path}","compare_url":"https://api.github.com/repos/BrandwatchLtd/axiom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrandwatchLtd/axiom/merges","archive_url":"https://api.github.com/repos/BrandwatchLtd/axiom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrandwatchLtd/axiom/downloads","issues_url":"https://api.github.com/repos/BrandwatchLtd/axiom/issues{/number}","pulls_url":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls{/number}","milestones_url":"https://api.github.com/repos/BrandwatchLtd/axiom/milestones{/number}","notifications_url":"https://api.github.com/repos/BrandwatchLtd/axiom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrandwatchLtd/axiom/labels{/name}","releases_url":"https://api.github.com/repos/BrandwatchLtd/axiom/releases{/id}","deployments_url":"https://api.github.com/repos/BrandwatchLtd/axiom/deployments","created_at":"2016-04-14T14:23:00Z","updated_at":"2018-08-15T15:48:14Z","pushed_at":"2018-08-16T10:07:47Z","git_url":"git://github.com/BrandwatchLtd/axiom.git","ssh_url":"git@github.com:BrandwatchLtd/axiom.git","clone_url":"https://github.com/BrandwatchLtd/axiom.git","svn_url":"https://github.com/BrandwatchLtd/axiom","homepage":"https://axiom.brandwatch.com","size":41650,"stargazers_count":31,"watchers_count":31,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":34,"open_issues":5,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614"},"html":{"href":"https://github.com/BrandwatchLtd/axiom/pull/614"},"issue":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/614"},"comments":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/issues/614/comments"},"review_comments":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614/comments"},"review_comment":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/pulls/614/commits"},"statuses":{"href":"https://api.github.com/repos/BrandwatchLtd/axiom/statuses/ca4e6ee7da7174df1305257d7946002cb1783050"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lpoulter"}}