{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/28988340","id":28988340,"diff_hunk":"@@ -60,7 +63,7 @@ CurrentTime.prototype = {\n       // inside timespan (eg. current time is 2014-05-22T23:59:50 and user is\n       // viewing 2014-05-23 until past midnight)\n       this._clearInterval();\n-      this._interval = setTimeout(this.activate.bind(this), diff);\n+      timeObserver.dayChange.once(this.activate);","path":"apps/calendar/js/views/current_time.js","position":22,"original_position":22,"commit_id":"aea74cadead954f252e4ba76d1d968f22f58ea37","original_commit_id":"aea74cadead954f252e4ba76d1d968f22f58ea37","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"body":"problem with `on('daychange'` is that a typo will go unnoticed.. that's the main reason why I prefer signals.","created_at":"2015-04-23T18:14:48Z","updated_at":"2015-04-23T18:14:48Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/29531#discussion_r28988340","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/28988340"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/29531#discussion_r28988340"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531","id":33405706,"html_url":"https://github.com/mozilla-b2g/gaia/pull/29531","diff_url":"https://github.com/mozilla-b2g/gaia/pull/29531.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/29531.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29531","number":29531,"state":"open","locked":false,"title":"Bug 1118850 - abstract day and minute change into the TimeObserver module to make sure we display the proper date/time on all the views r=gaye","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"body":"I could not reproduce any bug related to current day and current time after applying this patch.. I think the `visibilitychange` listener was the missing piece.\r\n\r\nnow it also executes the day check once per minute, before it was trying to do it once per day but I couldn't find what is the maximum value we can use on `setTimeout` and decided that doing a simple check once per minute wasn't too bad and would probably avoid headaches..\r\n\r\nit increased the amount of code drastically, but a good part of it is just the new test logic and keeping the methods on the `TimeObserver` with a single purpose.","created_at":"2015-04-15T23:13:32Z","updated_at":"2015-04-23T18:14:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61575b403432519693e8539e3b53eb1268c067d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29531/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/aea74cadead954f252e4ba76d1d968f22f58ea37","head":{"label":"millermedeiros:1118850-day-minute-change","ref":"1118850-day-minute-change","sha":"aea74cadead954f252e4ba76d1d968f22f58ea37","user":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"repo":{"id":15678349,"name":"gaia","full_name":"millermedeiros/gaia","owner":{"login":"millermedeiros","id":155633,"avatar_url":"https://avatars.githubusercontent.com/u/155633?v=3","gravatar_id":"","url":"https://api.github.com/users/millermedeiros","html_url":"https://github.com/millermedeiros","followers_url":"https://api.github.com/users/millermedeiros/followers","following_url":"https://api.github.com/users/millermedeiros/following{/other_user}","gists_url":"https://api.github.com/users/millermedeiros/gists{/gist_id}","starred_url":"https://api.github.com/users/millermedeiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millermedeiros/subscriptions","organizations_url":"https://api.github.com/users/millermedeiros/orgs","repos_url":"https://api.github.com/users/millermedeiros/repos","events_url":"https://api.github.com/users/millermedeiros/events{/privacy}","received_events_url":"https://api.github.com/users/millermedeiros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/millermedeiros/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see https://wiki.mozilla.org/Release_Management/B2G_Landing","fork":true,"url":"https://api.github.com/repos/millermedeiros/gaia","forks_url":"https://api.github.com/repos/millermedeiros/gaia/forks","keys_url":"https://api.github.com/repos/millermedeiros/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/millermedeiros/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/millermedeiros/gaia/teams","hooks_url":"https://api.github.com/repos/millermedeiros/gaia/hooks","issue_events_url":"https://api.github.com/repos/millermedeiros/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/millermedeiros/gaia/events","assignees_url":"https://api.github.com/repos/millermedeiros/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/millermedeiros/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/millermedeiros/gaia/tags","blobs_url":"https://api.github.com/repos/millermedeiros/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/millermedeiros/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/millermedeiros/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/millermedeiros/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/millermedeiros/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/millermedeiros/gaia/languages","stargazers_url":"https://api.github.com/repos/millermedeiros/gaia/stargazers","contributors_url":"https://api.github.com/repos/millermedeiros/gaia/contributors","subscribers_url":"https://api.github.com/repos/millermedeiros/gaia/subscribers","subscription_url":"https://api.github.com/repos/millermedeiros/gaia/subscription","commits_url":"https://api.github.com/repos/millermedeiros/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/millermedeiros/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/millermedeiros/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/millermedeiros/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/millermedeiros/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/millermedeiros/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/millermedeiros/gaia/merges","archive_url":"https://api.github.com/repos/millermedeiros/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/millermedeiros/gaia/downloads","issues_url":"https://api.github.com/repos/millermedeiros/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/millermedeiros/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/millermedeiros/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/millermedeiros/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/millermedeiros/gaia/labels{/name}","releases_url":"https://api.github.com/repos/millermedeiros/gaia/releases{/id}","created_at":"2014-01-06T16:05:19Z","updated_at":"2014-07-18T00:24:12Z","pushed_at":"2015-04-22T21:54:32Z","git_url":"git://github.com/millermedeiros/gaia.git","ssh_url":"git@github.com:millermedeiros/gaia.git","clone_url":"https://github.com/millermedeiros/gaia.git","svn_url":"https://github.com/millermedeiros/gaia","homepage":"https://wiki.mozilla.org/B2G","size":890064,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"eff65532a7b5a4edca995cf05b8f3ec5b56aaafa","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-04-23T17:29:27Z","pushed_at":"2015-04-23T18:13:01Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1523918,"stargazers_count":1908,"watchers_count":1908,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2286,"mirror_url":null,"open_issues_count":968,"forks":2286,"open_issues":968,"watchers":1908,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/29531"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29531"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/29531/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/29531/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/aea74cadead954f252e4ba76d1d968f22f58ea37"}}}}