{"action":"created","comment":{"url":"https://api.github.com/repos/getsentry/sentry/pulls/comments/230893414","pull_request_review_id":171732534,"id":230893414,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDg5MzQxNA==","diff_hunk":"@@ -0,0 +1,109 @@\n+import moment from 'moment';\n+\n+import {RETENTION_DAYS} from 'app/constants';\n+\n+function getParser(local = false) {\n+  return local ? moment : moment.utc;\n+}\n+\n+/**\n+ * Returns date \"RETENTION_DAYS\" ago\n+ */\n+export function getEarliestRetentionDate() {\n+  return moment()\n+    .subtract(RETENTION_DAYS, 'days')\n+    .toDate();\n+}\n+\n+/**\n+ * Return a date object in local time, when given a UTC timestamp\n+ */\n+export function getLocalDateObject(str) {\n+  return moment.utc(str).toDate();\n+}\n+\n+/**\n+ * Given a date object, format in datetime in UTC\n+ * given: Tue Oct 09 2018 00:00:00 GMT-0700 (Pacific Daylight Time)\n+ * returns: \"2018-10-09T07:00:00.000\"\n+ */\n+export function getUtcDateString(dateObj) {\n+  return moment.utc(dateObj).format(moment.HTML5_FMT.DATETIME_LOCAL_MS);\n+}\n+\n+export function getFormattedDate(dateObj, format, {local} = {}) {\n+  return getParser(local)(dateObj).format(format);\n+}\n+\n+/**\n+ * Sets time (hours + minutes) of the current date object\n+ *\n+ * @param {String} timeStr Time in 24hr format (HH:mm)\n+ */\n+export function setDateToTime(dateObj, timeStr, {local} = {}) {\n+  const [hours, minutes, seconds] = timeStr.split(':');\n+\n+  const date = getParser(local)(dateObj)\n+    .set('hours', hours)\n+    .set('minutes', minutes);\n+\n+  if (typeof seconds !== 'undefined') {\n+    date.set('seconds', seconds);\n+  }\n+\n+  return date.toDate();\n+}\n+\n+/**\n+ * Given a UTC timestamp, return a local date object with the same date\n+ * e.g. given: 1/1/2001 @ 22:00 UTC, return:  1/1/2001 @ 22:00 GMT-7\n+ */\n+export function getUtcInLocal(dateObj) {\n+  const utc = moment.utc(dateObj);\n+  const format = 'YYYY-MM-DD HH:mm:ss';\n+\n+  return moment(utc.format(format), format).toDate();\n+}\n+\n+/**\n+ * Given a local date, return a UTC date object with the same date\n+ * e.g. given: 1/1/2001 @ 22:00 GMT-7, return:  1/1/2001 @ 22:00 UTC\n+ */\n+export function getLocalToUtc(dateObj) {\n+  const localDate = moment(dateObj);\n+  const format = 'YYYY-MM-DD HH:mm:ss';\n+\n+  return moment.utc(localDate.format(format), format).toDate();\n+}\n+\n+export function isSameDay(start, end) {\n+  return moment(start)\n+    .add(1, 'day')\n+    .isSame(moment(end));","path":"src/sentry/static/sentry/app/utils/dates.jsx","position":82,"original_position":82,"commit_id":"4cbec63234181c80e685ebd271e833a4016d7053","original_commit_id":"4cbec63234181c80e685ebd271e833a4016d7053","user":{"login":"lynnagara","id":1779792,"node_id":"MDQ6VXNlcjE3Nzk3OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1779792?v=4","gravatar_id":"","url":"https://api.github.com/users/lynnagara","html_url":"https://github.com/lynnagara","followers_url":"https://api.github.com/users/lynnagara/followers","following_url":"https://api.github.com/users/lynnagara/following{/other_user}","gists_url":"https://api.github.com/users/lynnagara/gists{/gist_id}","starred_url":"https://api.github.com/users/lynnagara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lynnagara/subscriptions","organizations_url":"https://api.github.com/users/lynnagara/orgs","repos_url":"https://api.github.com/users/lynnagara/repos","events_url":"https://api.github.com/users/lynnagara/events{/privacy}","received_events_url":"https://api.github.com/users/lynnagara/received_events","type":"User","site_admin":false},"body":"Doesn't that just tell you if the dates are exactly 24 hours apart, not what actual calendar dates they fall on","created_at":"2018-11-05T20:05:49Z","updated_at":"2018-11-05T20:19:36Z","html_url":"https://github.com/getsentry/sentry/pull/10314#discussion_r230893414","pull_request_url":"https://api.github.com/repos/getsentry/sentry/pulls/10314","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/comments/230893414"},"html":{"href":"https://github.com/getsentry/sentry/pull/10314#discussion_r230893414"},"pull_request":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/10314"}}},"pull_request":{"url":"https://api.github.com/repos/getsentry/sentry/pulls/10314","id":226706804,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NzA2ODA0","html_url":"https://github.com/getsentry/sentry/pull/10314","diff_url":"https://github.com/getsentry/sentry/pull/10314.diff","patch_url":"https://github.com/getsentry/sentry/pull/10314.patch","issue_url":"https://api.github.com/repos/getsentry/sentry/issues/10314","number":10314,"state":"open","locked":false,"title":"feat(ui): New date range selector","user":{"login":"billyvg","id":79684,"node_id":"MDQ6VXNlcjc5Njg0","avatar_url":"https://avatars3.githubusercontent.com/u/79684?v=4","gravatar_id":"","url":"https://api.github.com/users/billyvg","html_url":"https://github.com/billyvg","followers_url":"https://api.github.com/users/billyvg/followers","following_url":"https://api.github.com/users/billyvg/following{/other_user}","gists_url":"https://api.github.com/users/billyvg/gists{/gist_id}","starred_url":"https://api.github.com/users/billyvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billyvg/subscriptions","organizations_url":"https://api.github.com/users/billyvg/orgs","repos_url":"https://api.github.com/users/billyvg/repos","events_url":"https://api.github.com/users/billyvg/events{/privacy}","received_events_url":"https://api.github.com/users/billyvg/received_events","type":"User","site_admin":false},"body":"New date range selector that includes a calendar view when selecting\r\nabsolute dates\r\n\r\nCloses APP-682\r\n\r\n![date-impliment](https://user-images.githubusercontent.com/435981/47878960-bbe9b780-dddc-11e8-8b93-76533bcd5503.gif)\r\n","created_at":"2018-10-29T20:43:13Z","updated_at":"2018-11-05T20:19:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29d8d1dd824803d263e0264a9097aa792b32cd85","assignee":{"login":"billyvg","id":79684,"node_id":"MDQ6VXNlcjc5Njg0","avatar_url":"https://avatars3.githubusercontent.com/u/79684?v=4","gravatar_id":"","url":"https://api.github.com/users/billyvg","html_url":"https://github.com/billyvg","followers_url":"https://api.github.com/users/billyvg/followers","following_url":"https://api.github.com/users/billyvg/following{/other_user}","gists_url":"https://api.github.com/users/billyvg/gists{/gist_id}","starred_url":"https://api.github.com/users/billyvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billyvg/subscriptions","organizations_url":"https://api.github.com/users/billyvg/orgs","repos_url":"https://api.github.com/users/billyvg/repos","events_url":"https://api.github.com/users/billyvg/events{/privacy}","received_events_url":"https://api.github.com/users/billyvg/received_events","type":"User","site_admin":false},"assignees":[{"login":"billyvg","id":79684,"node_id":"MDQ6VXNlcjc5Njg0","avatar_url":"https://avatars3.githubusercontent.com/u/79684?v=4","gravatar_id":"","url":"https://api.github.com/users/billyvg","html_url":"https://github.com/billyvg","followers_url":"https://api.github.com/users/billyvg/followers","following_url":"https://api.github.com/users/billyvg/following{/other_user}","gists_url":"https://api.github.com/users/billyvg/gists{/gist_id}","starred_url":"https://api.github.com/users/billyvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billyvg/subscriptions","organizations_url":"https://api.github.com/users/billyvg/orgs","repos_url":"https://api.github.com/users/billyvg/repos","events_url":"https://api.github.com/users/billyvg/events{/privacy}","received_events_url":"https://api.github.com/users/billyvg/received_events","type":"User","site_admin":false},{"login":"Chrissy","id":435981,"node_id":"MDQ6VXNlcjQzNTk4MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/435981?v=4","gravatar_id":"","url":"https://api.github.com/users/Chrissy","html_url":"https://github.com/Chrissy","followers_url":"https://api.github.com/users/Chrissy/followers","following_url":"https://api.github.com/users/Chrissy/following{/other_user}","gists_url":"https://api.github.com/users/Chrissy/gists{/gist_id}","starred_url":"https://api.github.com/users/Chrissy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chrissy/subscriptions","organizations_url":"https://api.github.com/users/Chrissy/orgs","repos_url":"https://api.github.com/users/Chrissy/repos","events_url":"https://api.github.com/users/Chrissy/events{/privacy}","received_events_url":"https://api.github.com/users/Chrissy/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/getsentry/sentry/pulls/10314/commits","review_comments_url":"https://api.github.com/repos/getsentry/sentry/pulls/10314/comments","review_comment_url":"https://api.github.com/repos/getsentry/sentry/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getsentry/sentry/issues/10314/comments","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/4cbec63234181c80e685ebd271e833a4016d7053","head":{"label":"getsentry:feat/ui/new-date-selector","ref":"feat/ui/new-date-selector","sha":"4cbec63234181c80e685ebd271e833a4016d7053","user":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"repo":{"id":873328,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzMjg=","name":"sentry","full_name":"getsentry/sentry","private":false,"owner":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/getsentry/sentry","description":"Sentry is cross-platform application monitoring, with a focus on error reporting.","fork":false,"url":"https://api.github.com/repos/getsentry/sentry","forks_url":"https://api.github.com/repos/getsentry/sentry/forks","keys_url":"https://api.github.com/repos/getsentry/sentry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getsentry/sentry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getsentry/sentry/teams","hooks_url":"https://api.github.com/repos/getsentry/sentry/hooks","issue_events_url":"https://api.github.com/repos/getsentry/sentry/issues/events{/number}","events_url":"https://api.github.com/repos/getsentry/sentry/events","assignees_url":"https://api.github.com/repos/getsentry/sentry/assignees{/user}","branches_url":"https://api.github.com/repos/getsentry/sentry/branches{/branch}","tags_url":"https://api.github.com/repos/getsentry/sentry/tags","blobs_url":"https://api.github.com/repos/getsentry/sentry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getsentry/sentry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getsentry/sentry/git/refs{/sha}","trees_url":"https://api.github.com/repos/getsentry/sentry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/{sha}","languages_url":"https://api.github.com/repos/getsentry/sentry/languages","stargazers_url":"https://api.github.com/repos/getsentry/sentry/stargazers","contributors_url":"https://api.github.com/repos/getsentry/sentry/contributors","subscribers_url":"https://api.github.com/repos/getsentry/sentry/subscribers","subscription_url":"https://api.github.com/repos/getsentry/sentry/subscription","commits_url":"https://api.github.com/repos/getsentry/sentry/commits{/sha}","git_commits_url":"https://api.github.com/repos/getsentry/sentry/git/commits{/sha}","comments_url":"https://api.github.com/repos/getsentry/sentry/comments{/number}","issue_comment_url":"https://api.github.com/repos/getsentry/sentry/issues/comments{/number}","contents_url":"https://api.github.com/repos/getsentry/sentry/contents/{+path}","compare_url":"https://api.github.com/repos/getsentry/sentry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getsentry/sentry/merges","archive_url":"https://api.github.com/repos/getsentry/sentry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getsentry/sentry/downloads","issues_url":"https://api.github.com/repos/getsentry/sentry/issues{/number}","pulls_url":"https://api.github.com/repos/getsentry/sentry/pulls{/number}","milestones_url":"https://api.github.com/repos/getsentry/sentry/milestones{/number}","notifications_url":"https://api.github.com/repos/getsentry/sentry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getsentry/sentry/labels{/name}","releases_url":"https://api.github.com/repos/getsentry/sentry/releases{/id}","deployments_url":"https://api.github.com/repos/getsentry/sentry/deployments","created_at":"2010-08-30T22:06:41Z","updated_at":"2018-11-05T18:45:32Z","pushed_at":"2018-11-05T20:14:23Z","git_url":"git://github.com/getsentry/sentry.git","ssh_url":"git@github.com:getsentry/sentry.git","clone_url":"https://github.com/getsentry/sentry.git","svn_url":"https://github.com/getsentry/sentry","homepage":"https://sentry.io","size":90736,"stargazers_count":18621,"watchers_count":18621,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2145,"mirror_url":null,"archived":false,"open_issues_count":773,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":2145,"open_issues":773,"watchers":18621,"default_branch":"master"}},"base":{"label":"getsentry:master","ref":"master","sha":"7b3e650414d59d936ed821f6f44cbea442fcfa22","user":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"repo":{"id":873328,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzMjg=","name":"sentry","full_name":"getsentry/sentry","private":false,"owner":{"login":"getsentry","id":1396951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1396951?v=4","gravatar_id":"","url":"https://api.github.com/users/getsentry","html_url":"https://github.com/getsentry","followers_url":"https://api.github.com/users/getsentry/followers","following_url":"https://api.github.com/users/getsentry/following{/other_user}","gists_url":"https://api.github.com/users/getsentry/gists{/gist_id}","starred_url":"https://api.github.com/users/getsentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getsentry/subscriptions","organizations_url":"https://api.github.com/users/getsentry/orgs","repos_url":"https://api.github.com/users/getsentry/repos","events_url":"https://api.github.com/users/getsentry/events{/privacy}","received_events_url":"https://api.github.com/users/getsentry/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/getsentry/sentry","description":"Sentry is cross-platform application monitoring, with a focus on error reporting.","fork":false,"url":"https://api.github.com/repos/getsentry/sentry","forks_url":"https://api.github.com/repos/getsentry/sentry/forks","keys_url":"https://api.github.com/repos/getsentry/sentry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getsentry/sentry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getsentry/sentry/teams","hooks_url":"https://api.github.com/repos/getsentry/sentry/hooks","issue_events_url":"https://api.github.com/repos/getsentry/sentry/issues/events{/number}","events_url":"https://api.github.com/repos/getsentry/sentry/events","assignees_url":"https://api.github.com/repos/getsentry/sentry/assignees{/user}","branches_url":"https://api.github.com/repos/getsentry/sentry/branches{/branch}","tags_url":"https://api.github.com/repos/getsentry/sentry/tags","blobs_url":"https://api.github.com/repos/getsentry/sentry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getsentry/sentry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getsentry/sentry/git/refs{/sha}","trees_url":"https://api.github.com/repos/getsentry/sentry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getsentry/sentry/statuses/{sha}","languages_url":"https://api.github.com/repos/getsentry/sentry/languages","stargazers_url":"https://api.github.com/repos/getsentry/sentry/stargazers","contributors_url":"https://api.github.com/repos/getsentry/sentry/contributors","subscribers_url":"https://api.github.com/repos/getsentry/sentry/subscribers","subscription_url":"https://api.github.com/repos/getsentry/sentry/subscription","commits_url":"https://api.github.com/repos/getsentry/sentry/commits{/sha}","git_commits_url":"https://api.github.com/repos/getsentry/sentry/git/commits{/sha}","comments_url":"https://api.github.com/repos/getsentry/sentry/comments{/number}","issue_comment_url":"https://api.github.com/repos/getsentry/sentry/issues/comments{/number}","contents_url":"https://api.github.com/repos/getsentry/sentry/contents/{+path}","compare_url":"https://api.github.com/repos/getsentry/sentry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getsentry/sentry/merges","archive_url":"https://api.github.com/repos/getsentry/sentry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getsentry/sentry/downloads","issues_url":"https://api.github.com/repos/getsentry/sentry/issues{/number}","pulls_url":"https://api.github.com/repos/getsentry/sentry/pulls{/number}","milestones_url":"https://api.github.com/repos/getsentry/sentry/milestones{/number}","notifications_url":"https://api.github.com/repos/getsentry/sentry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getsentry/sentry/labels{/name}","releases_url":"https://api.github.com/repos/getsentry/sentry/releases{/id}","deployments_url":"https://api.github.com/repos/getsentry/sentry/deployments","created_at":"2010-08-30T22:06:41Z","updated_at":"2018-11-05T18:45:32Z","pushed_at":"2018-11-05T20:14:23Z","git_url":"git://github.com/getsentry/sentry.git","ssh_url":"git@github.com:getsentry/sentry.git","clone_url":"https://github.com/getsentry/sentry.git","svn_url":"https://github.com/getsentry/sentry","homepage":"https://sentry.io","size":90736,"stargazers_count":18621,"watchers_count":18621,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2145,"mirror_url":null,"archived":false,"open_issues_count":773,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":2145,"open_issues":773,"watchers":18621,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/10314"},"html":{"href":"https://github.com/getsentry/sentry/pull/10314"},"issue":{"href":"https://api.github.com/repos/getsentry/sentry/issues/10314"},"comments":{"href":"https://api.github.com/repos/getsentry/sentry/issues/10314/comments"},"review_comments":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/10314/comments"},"review_comment":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getsentry/sentry/pulls/10314/commits"},"statuses":{"href":"https://api.github.com/repos/getsentry/sentry/statuses/4cbec63234181c80e685ebd271e833a4016d7053"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lynnagara"}}