{"action":"created","comment":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/comments/52463975","id":52463975,"diff_hunk":"@@ -0,0 +1,65 @@\n+/*!\n+ Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file>\n+ Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>\n+ Created By: urban@reciprocitylabs.com\n+ Maintained By: urban@reciprocitylabs.com\n+ */\n+\n+describe('can.mustache.helper.date', function () {\n+  'use strict';\n+\n+  var helper;\n+  var testDate;\n+\n+  beforeAll(function () {\n+    helper = can.Mustache._helpers.date.fn;\n+  });\n+\n+  it('returns date only when boolean true is passed in', function () {\n+    testDate = new Date(2015, 4, 3, 7, 34, 56);\n+    expect(helper(testDate, true)).toEqual('05/03/2015');\n+  });\n+\n+  it('returns datetime when stringy truthy value is passed in', function () {\n+    var timezone = moment(\n+      '2015-05-03T12:34:45Z').tz(moment.tz.guess()).format('z');\n+    testDate = new Date(2015, 4, 3, 7, 34, 56);\n+\n+    expect(helper(testDate, 'true')).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+  });\n+\n+  it('returns datetime when stringy falsey value is passed in', function () {\n+    var timezone = moment(\n+      '2015-05-03T12:34:45Z').tz(moment.tz.guess()).format('z');\n+    testDate = new Date(2015, 4, 3, 7, 34, 56);\n+\n+    expect(\n+      helper(testDate, 'false')).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+  });\n+\n+  it('returns datetime when false value is passed in', function () {\n+    var timezone = moment(\n+      '2015-05-03T12:34:45Z').tz(moment.tz.guess()).format('z');\n+    testDate = new Date(2015, 4, 3, 7, 34, 56);\n+\n+    expect(\n+      helper(testDate, false)).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+  });\n+\n+\n+  it('returns datetime when random values are passed in', function () {\n+    var timezone = moment(\n+      '2015-05-03T12:34:45Z').tz(moment.tz.guess()).format('z');\n+    testDate = new Date(2015, 4, 3, 7, 34, 56);\n+\n+    expect(\n+      helper(testDate, 'asdasd')).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+    expect(\n+      helper(testDate, {a: 1})).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+    expect(\n+      helper(testDate, '{a: 1}')).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+    expect(\n+      helper(testDate, 123)).toEqual('05/03/2015 07:34:56 AM '+ timezone);\n+  });\n+\n+});","path":"src/ggrc/assets/js_specs/mustache_helpers/date_spec.js","position":65,"original_position":65,"commit_id":"9145e83b6bd6d310e0970aeda88030ed4c0d3738","original_commit_id":"9145e83b6bd6d310e0970aeda88030ed4c0d3738","user":{"login":"uskudnik","id":120451,"avatar_url":"https://avatars.githubusercontent.com/u/120451?v=3","gravatar_id":"","url":"https://api.github.com/users/uskudnik","html_url":"https://github.com/uskudnik","followers_url":"https://api.github.com/users/uskudnik/followers","following_url":"https://api.github.com/users/uskudnik/following{/other_user}","gists_url":"https://api.github.com/users/uskudnik/gists{/gist_id}","starred_url":"https://api.github.com/users/uskudnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uskudnik/subscriptions","organizations_url":"https://api.github.com/users/uskudnik/orgs","repos_url":"https://api.github.com/users/uskudnik/repos","events_url":"https://api.github.com/users/uskudnik/events{/privacy}","received_events_url":"https://api.github.com/users/uskudnik/received_events","type":"User","site_admin":false},"body":"Everything is green as you can see...","created_at":"2016-02-10T14:33:17Z","updated_at":"2016-02-10T14:33:17Z","html_url":"https://github.com/google/ggrc-core/pull/3542#discussion_r52463975","pull_request_url":"https://api.github.com/repos/google/ggrc-core/pulls/3542","_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments/52463975"},"html":{"href":"https://github.com/google/ggrc-core/pull/3542#discussion_r52463975"},"pull_request":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/3542"}}},"pull_request":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/3542","id":57856293,"html_url":"https://github.com/google/ggrc-core/pull/3542","diff_url":"https://github.com/google/ggrc-core/pull/3542.diff","patch_url":"https://github.com/google/ggrc-core/pull/3542.patch","issue_url":"https://api.github.com/repos/google/ggrc-core/issues/3542","number":3542,"state":"open","locked":false,"title":"CORE-2803 Render datetime in local time","user":{"login":"uskudnik","id":120451,"avatar_url":"https://avatars.githubusercontent.com/u/120451?v=3","gravatar_id":"","url":"https://api.github.com/users/uskudnik","html_url":"https://github.com/uskudnik","followers_url":"https://api.github.com/users/uskudnik/followers","following_url":"https://api.github.com/users/uskudnik/following{/other_user}","gists_url":"https://api.github.com/users/uskudnik/gists{/gist_id}","starred_url":"https://api.github.com/users/uskudnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uskudnik/subscriptions","organizations_url":"https://api.github.com/users/uskudnik/orgs","repos_url":"https://api.github.com/users/uskudnik/repos","events_url":"https://api.github.com/users/uskudnik/events{/privacy}","received_events_url":"https://api.github.com/users/uskudnik/received_events","type":"User","site_admin":false},"body":"This PR renders times in local time but it has issues with times that go across winter/summer time. Winter/summer label (CET/CEST) gets render correctly but the rendering sets offset from UTC per current offset and not offset at the time of post - this means that a post made during the winter at 4:35 PM CET (3:35 PM UTC) get rendered as 5:35 PM CET during summer when +2 offset is in play for CEST.\r\n\r\nPer discussion with Prasanna that is not an issue for now (since we save in UTC anyway and it's only a rendering issue), created a ticket for technical debt.","created_at":"2016-02-01T15:42:26Z","updated_at":"2016-02-10T14:33:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c947567b78227b3ba0b8dd19210d09a7399302e","assignee":{"login":"uskudnik","id":120451,"avatar_url":"https://avatars.githubusercontent.com/u/120451?v=3","gravatar_id":"","url":"https://api.github.com/users/uskudnik","html_url":"https://github.com/uskudnik","followers_url":"https://api.github.com/users/uskudnik/followers","following_url":"https://api.github.com/users/uskudnik/following{/other_user}","gists_url":"https://api.github.com/users/uskudnik/gists{/gist_id}","starred_url":"https://api.github.com/users/uskudnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uskudnik/subscriptions","organizations_url":"https://api.github.com/users/uskudnik/orgs","repos_url":"https://api.github.com/users/uskudnik/repos","events_url":"https://api.github.com/users/uskudnik/events{/privacy}","received_events_url":"https://api.github.com/users/uskudnik/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/google/ggrc-core/milestones/16","html_url":"https://github.com/google/ggrc-core/milestones/0.9.6-Plum%20Jelly","labels_url":"https://api.github.com/repos/google/ggrc-core/milestones/16/labels","id":1058061,"number":16,"title":"0.9.6-Plum Jelly","description":"","creator":{"login":"Smotko","id":513444,"avatar_url":"https://avatars.githubusercontent.com/u/513444?v=3","gravatar_id":"","url":"https://api.github.com/users/Smotko","html_url":"https://github.com/Smotko","followers_url":"https://api.github.com/users/Smotko/followers","following_url":"https://api.github.com/users/Smotko/following{/other_user}","gists_url":"https://api.github.com/users/Smotko/gists{/gist_id}","starred_url":"https://api.github.com/users/Smotko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smotko/subscriptions","organizations_url":"https://api.github.com/users/Smotko/orgs","repos_url":"https://api.github.com/users/Smotko/repos","events_url":"https://api.github.com/users/Smotko/events{/privacy}","received_events_url":"https://api.github.com/users/Smotko/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":112,"state":"open","created_at":"2015-04-08T11:38:13Z","updated_at":"2016-02-10T14:29:51Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/google/ggrc-core/pulls/3542/commits","review_comments_url":"https://api.github.com/repos/google/ggrc-core/pulls/3542/comments","review_comment_url":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/ggrc-core/issues/3542/comments","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/9145e83b6bd6d310e0970aeda88030ed4c0d3738","head":{"label":"uskudnik:feature/CORE-2803-render-local-timezone","ref":"feature/CORE-2803-render-local-timezone","sha":"9145e83b6bd6d310e0970aeda88030ed4c0d3738","user":{"login":"uskudnik","id":120451,"avatar_url":"https://avatars.githubusercontent.com/u/120451?v=3","gravatar_id":"","url":"https://api.github.com/users/uskudnik","html_url":"https://github.com/uskudnik","followers_url":"https://api.github.com/users/uskudnik/followers","following_url":"https://api.github.com/users/uskudnik/following{/other_user}","gists_url":"https://api.github.com/users/uskudnik/gists{/gist_id}","starred_url":"https://api.github.com/users/uskudnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uskudnik/subscriptions","organizations_url":"https://api.github.com/users/uskudnik/orgs","repos_url":"https://api.github.com/users/uskudnik/repos","events_url":"https://api.github.com/users/uskudnik/events{/privacy}","received_events_url":"https://api.github.com/users/uskudnik/received_events","type":"User","site_admin":false},"repo":{"id":36459094,"name":"ggrc-core","full_name":"uskudnik/ggrc-core","owner":{"login":"uskudnik","id":120451,"avatar_url":"https://avatars.githubusercontent.com/u/120451?v=3","gravatar_id":"","url":"https://api.github.com/users/uskudnik","html_url":"https://github.com/uskudnik","followers_url":"https://api.github.com/users/uskudnik/followers","following_url":"https://api.github.com/users/uskudnik/following{/other_user}","gists_url":"https://api.github.com/users/uskudnik/gists{/gist_id}","starred_url":"https://api.github.com/users/uskudnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uskudnik/subscriptions","organizations_url":"https://api.github.com/users/uskudnik/orgs","repos_url":"https://api.github.com/users/uskudnik/repos","events_url":"https://api.github.com/users/uskudnik/events{/privacy}","received_events_url":"https://api.github.com/users/uskudnik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uskudnik/ggrc-core","description":"GGRC Core","fork":true,"url":"https://api.github.com/repos/uskudnik/ggrc-core","forks_url":"https://api.github.com/repos/uskudnik/ggrc-core/forks","keys_url":"https://api.github.com/repos/uskudnik/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uskudnik/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uskudnik/ggrc-core/teams","hooks_url":"https://api.github.com/repos/uskudnik/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/uskudnik/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/uskudnik/ggrc-core/events","assignees_url":"https://api.github.com/repos/uskudnik/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/uskudnik/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/uskudnik/ggrc-core/tags","blobs_url":"https://api.github.com/repos/uskudnik/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uskudnik/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uskudnik/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/uskudnik/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uskudnik/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/uskudnik/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/uskudnik/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/uskudnik/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/uskudnik/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/uskudnik/ggrc-core/subscription","commits_url":"https://api.github.com/repos/uskudnik/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/uskudnik/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/uskudnik/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/uskudnik/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/uskudnik/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/uskudnik/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uskudnik/ggrc-core/merges","archive_url":"https://api.github.com/repos/uskudnik/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uskudnik/ggrc-core/downloads","issues_url":"https://api.github.com/repos/uskudnik/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/uskudnik/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/uskudnik/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/uskudnik/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uskudnik/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/uskudnik/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/uskudnik/ggrc-core/deployments","created_at":"2015-05-28T18:50:16Z","updated_at":"2015-05-28T18:50:20Z","pushed_at":"2016-02-10T14:28:32Z","git_url":"git://github.com/uskudnik/ggrc-core.git","ssh_url":"git@github.com:uskudnik/ggrc-core.git","clone_url":"https://github.com/uskudnik/ggrc-core.git","svn_url":"https://github.com/uskudnik/ggrc-core","homepage":null,"size":49012,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"google:develop","ref":"develop","sha":"d4bfdd52407caaaf041b269e489cc6fe7ac52721","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":9304637,"name":"ggrc-core","full_name":"google/ggrc-core","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ggrc-core","description":"GGRC Core","fork":false,"url":"https://api.github.com/repos/google/ggrc-core","forks_url":"https://api.github.com/repos/google/ggrc-core/forks","keys_url":"https://api.github.com/repos/google/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ggrc-core/teams","hooks_url":"https://api.github.com/repos/google/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/google/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/google/ggrc-core/events","assignees_url":"https://api.github.com/repos/google/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/google/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/google/ggrc-core/tags","blobs_url":"https://api.github.com/repos/google/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/google/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/google/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/google/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/google/ggrc-core/subscription","commits_url":"https://api.github.com/repos/google/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/google/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ggrc-core/merges","archive_url":"https://api.github.com/repos/google/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ggrc-core/downloads","issues_url":"https://api.github.com/repos/google/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/google/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/google/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/google/ggrc-core/deployments","created_at":"2013-04-08T19:16:28Z","updated_at":"2016-02-09T11:37:49Z","pushed_at":"2016-02-10T14:29:52Z","git_url":"git://github.com/google/ggrc-core.git","ssh_url":"git@github.com:google/ggrc-core.git","clone_url":"https://github.com/google/ggrc-core.git","svn_url":"https://github.com/google/ggrc-core","homepage":null,"size":55890,"stargazers_count":65,"watchers_count":65,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":12,"forks":43,"open_issues":12,"watchers":65,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/3542"},"html":{"href":"https://github.com/google/ggrc-core/pull/3542"},"issue":{"href":"https://api.github.com/repos/google/ggrc-core/issues/3542"},"comments":{"href":"https://api.github.com/repos/google/ggrc-core/issues/3542/comments"},"review_comments":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/3542/comments"},"review_comment":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/3542/commits"},"statuses":{"href":"https://api.github.com/repos/google/ggrc-core/statuses/9145e83b6bd6d310e0970aeda88030ed4c0d3738"}}}}