{"action":"created","comment":{"url":"https://api.github.com/repos/metabase/metabase/pulls/comments/58447949","id":58447949,"diff_hunk":"@@ -0,0 +1,13 @@\n+import moment from \"moment\";\n+\n+// only attempt to parse the timezone if we're sure we have one (either Z or ±hh:mm)\n+// moment normally interprets the DD in YYYY-MM-DD as an offset :-/\n+export function parseTimestamp(value) {\n+    if (moment.isMoment(value)) {\n+        return value;\n+    } else if (typeof value === \"string\" && /(Z|[+-]\\d\\d:\\d\\d)$/.test(value)) {\n+        return moment.parseZone(value);\n+    } else {\n+        return moment.utc(value);","path":"frontend/src/lib/time.js","position":11,"original_position":11,"commit_id":"d618c84e46caaf14c7beb6a64e669c322d075136","original_commit_id":"d618c84e46caaf14c7beb6a64e669c322d075136","user":{"login":"tlrobinson","id":18193,"avatar_url":"https://avatars.githubusercontent.com/u/18193?v=3","gravatar_id":"","url":"https://api.github.com/users/tlrobinson","html_url":"https://github.com/tlrobinson","followers_url":"https://api.github.com/users/tlrobinson/followers","following_url":"https://api.github.com/users/tlrobinson/following{/other_user}","gists_url":"https://api.github.com/users/tlrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tlrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlrobinson/subscriptions","organizations_url":"https://api.github.com/users/tlrobinson/orgs","repos_url":"https://api.github.com/users/tlrobinson/repos","events_url":"https://api.github.com/users/tlrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/tlrobinson/received_events","type":"User","site_admin":false},"body":"You would think so, but nope. https://github.com/moment/moment/issues/3083","created_at":"2016-04-04T21:00:00Z","updated_at":"2016-04-04T21:00:00Z","html_url":"https://github.com/metabase/metabase/pull/2303#discussion_r58447949","pull_request_url":"https://api.github.com/repos/metabase/metabase/pulls/2303","_links":{"self":{"href":"https://api.github.com/repos/metabase/metabase/pulls/comments/58447949"},"html":{"href":"https://github.com/metabase/metabase/pull/2303#discussion_r58447949"},"pull_request":{"href":"https://api.github.com/repos/metabase/metabase/pulls/2303"}}},"pull_request":{"url":"https://api.github.com/repos/metabase/metabase/pulls/2303","id":65207167,"html_url":"https://github.com/metabase/metabase/pull/2303","diff_url":"https://github.com/metabase/metabase/pull/2303.diff","patch_url":"https://github.com/metabase/metabase/pull/2303.patch","issue_url":"https://api.github.com/repos/metabase/metabase/issues/2303","number":2303,"state":"open","locked":false,"title":"Fix date parsing","user":{"login":"tlrobinson","id":18193,"avatar_url":"https://avatars.githubusercontent.com/u/18193?v=3","gravatar_id":"","url":"https://api.github.com/users/tlrobinson","html_url":"https://github.com/tlrobinson","followers_url":"https://api.github.com/users/tlrobinson/followers","following_url":"https://api.github.com/users/tlrobinson/following{/other_user}","gists_url":"https://api.github.com/users/tlrobinson/gists{/gist_id}","starred_url":"https://api.github.com/users/tlrobinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlrobinson/subscriptions","organizations_url":"https://api.github.com/users/tlrobinson/orgs","repos_url":"https://api.github.com/users/tlrobinson/repos","events_url":"https://api.github.com/users/tlrobinson/events{/privacy}","received_events_url":"https://api.github.com/users/tlrobinson/received_events","type":"User","site_admin":false},"body":"Ok, I think this is a sane way to handle this. If we know a string has a `±hh:mm` timezone offset or `Z` suffix we use that in the parsing, otherwise we assume UTC.\r\n\r\nResolves #2282\r\n\r\nAlso removes using `utcOffset` in formatting, since timestamps from the same timezone may have different offsets if they span both DST and standard time.\r\n\r\nResolves #2288\r\n","created_at":"2016-04-04T20:25:50Z","updated_at":"2016-04-04T21:00:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2722297d427873d2b2a6841a22da130b571ab7af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/metabase/metabase/pulls/2303/commits","review_comments_url":"https://api.github.com/repos/metabase/metabase/pulls/2303/comments","review_comment_url":"https://api.github.com/repos/metabase/metabase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/2303/comments","statuses_url":"https://api.github.com/repos/metabase/metabase/statuses/d618c84e46caaf14c7beb6a64e669c322d075136","head":{"label":"metabase:fix-date-parsing","ref":"fix-date-parsing","sha":"d618c84e46caaf14c7beb6a64e669c322d075136","user":{"login":"metabase","id":10520629,"avatar_url":"https://avatars.githubusercontent.com/u/10520629?v=3","gravatar_id":"","url":"https://api.github.com/users/metabase","html_url":"https://github.com/metabase","followers_url":"https://api.github.com/users/metabase/followers","following_url":"https://api.github.com/users/metabase/following{/other_user}","gists_url":"https://api.github.com/users/metabase/gists{/gist_id}","starred_url":"https://api.github.com/users/metabase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabase/subscriptions","organizations_url":"https://api.github.com/users/metabase/orgs","repos_url":"https://api.github.com/users/metabase/repos","events_url":"https://api.github.com/users/metabase/events{/privacy}","received_events_url":"https://api.github.com/users/metabase/received_events","type":"Organization","site_admin":false},"repo":{"id":30203935,"name":"metabase","full_name":"metabase/metabase","owner":{"login":"metabase","id":10520629,"avatar_url":"https://avatars.githubusercontent.com/u/10520629?v=3","gravatar_id":"","url":"https://api.github.com/users/metabase","html_url":"https://github.com/metabase","followers_url":"https://api.github.com/users/metabase/followers","following_url":"https://api.github.com/users/metabase/following{/other_user}","gists_url":"https://api.github.com/users/metabase/gists{/gist_id}","starred_url":"https://api.github.com/users/metabase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabase/subscriptions","organizations_url":"https://api.github.com/users/metabase/orgs","repos_url":"https://api.github.com/users/metabase/repos","events_url":"https://api.github.com/users/metabase/events{/privacy}","received_events_url":"https://api.github.com/users/metabase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metabase/metabase","description":"The simplest, fastest way to get business intelligence and analytics  to everyone in your company :yum:","fork":false,"url":"https://api.github.com/repos/metabase/metabase","forks_url":"https://api.github.com/repos/metabase/metabase/forks","keys_url":"https://api.github.com/repos/metabase/metabase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metabase/metabase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metabase/metabase/teams","hooks_url":"https://api.github.com/repos/metabase/metabase/hooks","issue_events_url":"https://api.github.com/repos/metabase/metabase/issues/events{/number}","events_url":"https://api.github.com/repos/metabase/metabase/events","assignees_url":"https://api.github.com/repos/metabase/metabase/assignees{/user}","branches_url":"https://api.github.com/repos/metabase/metabase/branches{/branch}","tags_url":"https://api.github.com/repos/metabase/metabase/tags","blobs_url":"https://api.github.com/repos/metabase/metabase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metabase/metabase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metabase/metabase/git/refs{/sha}","trees_url":"https://api.github.com/repos/metabase/metabase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metabase/metabase/statuses/{sha}","languages_url":"https://api.github.com/repos/metabase/metabase/languages","stargazers_url":"https://api.github.com/repos/metabase/metabase/stargazers","contributors_url":"https://api.github.com/repos/metabase/metabase/contributors","subscribers_url":"https://api.github.com/repos/metabase/metabase/subscribers","subscription_url":"https://api.github.com/repos/metabase/metabase/subscription","commits_url":"https://api.github.com/repos/metabase/metabase/commits{/sha}","git_commits_url":"https://api.github.com/repos/metabase/metabase/git/commits{/sha}","comments_url":"https://api.github.com/repos/metabase/metabase/comments{/number}","issue_comment_url":"https://api.github.com/repos/metabase/metabase/issues/comments{/number}","contents_url":"https://api.github.com/repos/metabase/metabase/contents/{+path}","compare_url":"https://api.github.com/repos/metabase/metabase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metabase/metabase/merges","archive_url":"https://api.github.com/repos/metabase/metabase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metabase/metabase/downloads","issues_url":"https://api.github.com/repos/metabase/metabase/issues{/number}","pulls_url":"https://api.github.com/repos/metabase/metabase/pulls{/number}","milestones_url":"https://api.github.com/repos/metabase/metabase/milestones{/number}","notifications_url":"https://api.github.com/repos/metabase/metabase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metabase/metabase/labels{/name}","releases_url":"https://api.github.com/repos/metabase/metabase/releases{/id}","deployments_url":"https://api.github.com/repos/metabase/metabase/deployments","created_at":"2015-02-02T19:25:47Z","updated_at":"2016-04-04T19:26:42Z","pushed_at":"2016-04-04T20:25:51Z","git_url":"git://github.com/metabase/metabase.git","ssh_url":"git@github.com:metabase/metabase.git","clone_url":"https://github.com/metabase/metabase.git","svn_url":"https://github.com/metabase/metabase","homepage":"http://metabase.com","size":35293,"stargazers_count":2451,"watchers_count":2451,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"open_issues_count":279,"forks":126,"open_issues":279,"watchers":2451,"default_branch":"master"}},"base":{"label":"metabase:release-0.16.1","ref":"release-0.16.1","sha":"c1eddc5ae471e639da80dd26e3e3f84d21d7447e","user":{"login":"metabase","id":10520629,"avatar_url":"https://avatars.githubusercontent.com/u/10520629?v=3","gravatar_id":"","url":"https://api.github.com/users/metabase","html_url":"https://github.com/metabase","followers_url":"https://api.github.com/users/metabase/followers","following_url":"https://api.github.com/users/metabase/following{/other_user}","gists_url":"https://api.github.com/users/metabase/gists{/gist_id}","starred_url":"https://api.github.com/users/metabase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabase/subscriptions","organizations_url":"https://api.github.com/users/metabase/orgs","repos_url":"https://api.github.com/users/metabase/repos","events_url":"https://api.github.com/users/metabase/events{/privacy}","received_events_url":"https://api.github.com/users/metabase/received_events","type":"Organization","site_admin":false},"repo":{"id":30203935,"name":"metabase","full_name":"metabase/metabase","owner":{"login":"metabase","id":10520629,"avatar_url":"https://avatars.githubusercontent.com/u/10520629?v=3","gravatar_id":"","url":"https://api.github.com/users/metabase","html_url":"https://github.com/metabase","followers_url":"https://api.github.com/users/metabase/followers","following_url":"https://api.github.com/users/metabase/following{/other_user}","gists_url":"https://api.github.com/users/metabase/gists{/gist_id}","starred_url":"https://api.github.com/users/metabase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metabase/subscriptions","organizations_url":"https://api.github.com/users/metabase/orgs","repos_url":"https://api.github.com/users/metabase/repos","events_url":"https://api.github.com/users/metabase/events{/privacy}","received_events_url":"https://api.github.com/users/metabase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metabase/metabase","description":"The simplest, fastest way to get business intelligence and analytics  to everyone in your company :yum:","fork":false,"url":"https://api.github.com/repos/metabase/metabase","forks_url":"https://api.github.com/repos/metabase/metabase/forks","keys_url":"https://api.github.com/repos/metabase/metabase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metabase/metabase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metabase/metabase/teams","hooks_url":"https://api.github.com/repos/metabase/metabase/hooks","issue_events_url":"https://api.github.com/repos/metabase/metabase/issues/events{/number}","events_url":"https://api.github.com/repos/metabase/metabase/events","assignees_url":"https://api.github.com/repos/metabase/metabase/assignees{/user}","branches_url":"https://api.github.com/repos/metabase/metabase/branches{/branch}","tags_url":"https://api.github.com/repos/metabase/metabase/tags","blobs_url":"https://api.github.com/repos/metabase/metabase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metabase/metabase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metabase/metabase/git/refs{/sha}","trees_url":"https://api.github.com/repos/metabase/metabase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metabase/metabase/statuses/{sha}","languages_url":"https://api.github.com/repos/metabase/metabase/languages","stargazers_url":"https://api.github.com/repos/metabase/metabase/stargazers","contributors_url":"https://api.github.com/repos/metabase/metabase/contributors","subscribers_url":"https://api.github.com/repos/metabase/metabase/subscribers","subscription_url":"https://api.github.com/repos/metabase/metabase/subscription","commits_url":"https://api.github.com/repos/metabase/metabase/commits{/sha}","git_commits_url":"https://api.github.com/repos/metabase/metabase/git/commits{/sha}","comments_url":"https://api.github.com/repos/metabase/metabase/comments{/number}","issue_comment_url":"https://api.github.com/repos/metabase/metabase/issues/comments{/number}","contents_url":"https://api.github.com/repos/metabase/metabase/contents/{+path}","compare_url":"https://api.github.com/repos/metabase/metabase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metabase/metabase/merges","archive_url":"https://api.github.com/repos/metabase/metabase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metabase/metabase/downloads","issues_url":"https://api.github.com/repos/metabase/metabase/issues{/number}","pulls_url":"https://api.github.com/repos/metabase/metabase/pulls{/number}","milestones_url":"https://api.github.com/repos/metabase/metabase/milestones{/number}","notifications_url":"https://api.github.com/repos/metabase/metabase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metabase/metabase/labels{/name}","releases_url":"https://api.github.com/repos/metabase/metabase/releases{/id}","deployments_url":"https://api.github.com/repos/metabase/metabase/deployments","created_at":"2015-02-02T19:25:47Z","updated_at":"2016-04-04T19:26:42Z","pushed_at":"2016-04-04T20:25:51Z","git_url":"git://github.com/metabase/metabase.git","ssh_url":"git@github.com:metabase/metabase.git","clone_url":"https://github.com/metabase/metabase.git","svn_url":"https://github.com/metabase/metabase","homepage":"http://metabase.com","size":35293,"stargazers_count":2451,"watchers_count":2451,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":126,"mirror_url":null,"open_issues_count":279,"forks":126,"open_issues":279,"watchers":2451,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metabase/metabase/pulls/2303"},"html":{"href":"https://github.com/metabase/metabase/pull/2303"},"issue":{"href":"https://api.github.com/repos/metabase/metabase/issues/2303"},"comments":{"href":"https://api.github.com/repos/metabase/metabase/issues/2303/comments"},"review_comments":{"href":"https://api.github.com/repos/metabase/metabase/pulls/2303/comments"},"review_comment":{"href":"https://api.github.com/repos/metabase/metabase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metabase/metabase/pulls/2303/commits"},"statuses":{"href":"https://api.github.com/repos/metabase/metabase/statuses/d618c84e46caaf14c7beb6a64e669c322d075136"}}}}