{"action":"created","comment":{"url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/comments/77596575","id":77596575,"diff_hunk":"@@ -2,15 +2,33 @@\n \n angular.module('cpZenPlatform').factory('eventUtils', ['$translate', function($translate){\n   var eventUtils = {};\n-  eventUtils.isEventInPast = function(dateObj){\n+  eventUtils.isEventInPast = function (dateObj) {\n     var now = moment.utc();\n     var eventUtcOffset = moment(dateObj.startTime).utcOffset();\n     var start = moment.utc(dateObj.startTime).subtract(eventUtcOffset, 'minutes');\n \n     return now.isAfter(start);\n   }\n \n-  eventUtils.getFormattedDates = function(event) {\n+  eventUtils.getNextDates = function (dates, formattedDates) {\n+    var nextDateIndex = void 0;\n+    var eventIndex = 0;\n+    while (eventIndex < dates.length && _.isUndefined(nextDateIndex)) {\n+      var date = dates[eventIndex];\n+      if (!eventUtils.isEventInPast(date)) {\n+        nextDateIndex = eventIndex;\n+      }\n+      eventIndex +=1;\n+    }\n+\n+    if (nextDateIndex >= 0 && formattedDates) {\n+      return formattedDates.slice(nextDateIndex);\n+    }\n+    // Congrats, you called this function upon an past event\n+    return false;","path":"web/public/js/services/event-utils.js","position":29,"original_position":29,"commit_id":"b8adff66778162e0146cd46bdb8b6f3871684b5b","original_commit_id":"b8adff66778162e0146cd46bdb8b6f3871684b5b","user":{"login":"butlerx","id":867930,"avatar_url":"https://avatars.githubusercontent.com/u/867930?v=3","gravatar_id":"","url":"https://api.github.com/users/butlerx","html_url":"https://github.com/butlerx","followers_url":"https://api.github.com/users/butlerx/followers","following_url":"https://api.github.com/users/butlerx/following{/other_user}","gists_url":"https://api.github.com/users/butlerx/gists{/gist_id}","starred_url":"https://api.github.com/users/butlerx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/butlerx/subscriptions","organizations_url":"https://api.github.com/users/butlerx/orgs","repos_url":"https://api.github.com/users/butlerx/repos","events_url":"https://api.github.com/users/butlerx/events{/privacy}","received_events_url":"https://api.github.com/users/butlerx/received_events","type":"User","site_admin":false},"body":"id agree","created_at":"2016-09-06T08:58:51Z","updated_at":"2016-09-06T08:58:51Z","html_url":"https://github.com/CoderDojo/cp-zen-platform/pull/994#discussion_r77596575","pull_request_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994","_links":{"self":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/comments/77596575"},"html":{"href":"https://github.com/CoderDojo/cp-zen-platform/pull/994#discussion_r77596575"},"pull_request":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994"}}},"pull_request":{"url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994","id":84032580,"html_url":"https://github.com/CoderDojo/cp-zen-platform/pull/994","diff_url":"https://github.com/CoderDojo/cp-zen-platform/pull/994.diff","patch_url":"https://github.com/CoderDojo/cp-zen-platform/pull/994.patch","issue_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/994","number":994,"state":"open","locked":false,"title":"ui bugfix : recurring event for detail page, default space for buttons w/ icons","user":{"login":"Wardormeur","id":1755357,"avatar_url":"https://avatars.githubusercontent.com/u/1755357?v=3","gravatar_id":"","url":"https://api.github.com/users/Wardormeur","html_url":"https://github.com/Wardormeur","followers_url":"https://api.github.com/users/Wardormeur/followers","following_url":"https://api.github.com/users/Wardormeur/following{/other_user}","gists_url":"https://api.github.com/users/Wardormeur/gists{/gist_id}","starred_url":"https://api.github.com/users/Wardormeur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wardormeur/subscriptions","organizations_url":"https://api.github.com/users/Wardormeur/orgs","repos_url":"https://api.github.com/users/Wardormeur/repos","events_url":"https://api.github.com/users/Wardormeur/events{/privacy}","received_events_url":"https://api.github.com/users/Wardormeur/received_events","type":"User","site_admin":false},"body":"Refactored code from last week to apply the same behavior to event detail (TODO : real UI, it's ugly AF, remove the popup plz)\r\nRemove original catchall for .fa inside buttons to replace it with a hack that shouldn't impact anybody but leave it with a default space when the class is missing. TODO : add the real margin by adding the class to the necessary buttons","created_at":"2016-09-05T18:49:37Z","updated_at":"2016-09-06T08:58:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa06ed703817dd01e1fb7b8d5fa15b16faed7883","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994/commits","review_comments_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994/comments","review_comment_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/994/comments","statuses_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/statuses/b8adff66778162e0146cd46bdb8b6f3871684b5b","head":{"label":"Wardormeur:bugfix/fix-display-recurrent-event-page","ref":"bugfix/fix-display-recurrent-event-page","sha":"b8adff66778162e0146cd46bdb8b6f3871684b5b","user":{"login":"Wardormeur","id":1755357,"avatar_url":"https://avatars.githubusercontent.com/u/1755357?v=3","gravatar_id":"","url":"https://api.github.com/users/Wardormeur","html_url":"https://github.com/Wardormeur","followers_url":"https://api.github.com/users/Wardormeur/followers","following_url":"https://api.github.com/users/Wardormeur/following{/other_user}","gists_url":"https://api.github.com/users/Wardormeur/gists{/gist_id}","starred_url":"https://api.github.com/users/Wardormeur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wardormeur/subscriptions","organizations_url":"https://api.github.com/users/Wardormeur/orgs","repos_url":"https://api.github.com/users/Wardormeur/repos","events_url":"https://api.github.com/users/Wardormeur/events{/privacy}","received_events_url":"https://api.github.com/users/Wardormeur/received_events","type":"User","site_admin":false},"repo":{"id":50093081,"name":"cp-zen-platform","full_name":"Wardormeur/cp-zen-platform","owner":{"login":"Wardormeur","id":1755357,"avatar_url":"https://avatars.githubusercontent.com/u/1755357?v=3","gravatar_id":"","url":"https://api.github.com/users/Wardormeur","html_url":"https://github.com/Wardormeur","followers_url":"https://api.github.com/users/Wardormeur/followers","following_url":"https://api.github.com/users/Wardormeur/following{/other_user}","gists_url":"https://api.github.com/users/Wardormeur/gists{/gist_id}","starred_url":"https://api.github.com/users/Wardormeur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wardormeur/subscriptions","organizations_url":"https://api.github.com/users/Wardormeur/orgs","repos_url":"https://api.github.com/users/Wardormeur/repos","events_url":"https://api.github.com/users/Wardormeur/events{/privacy}","received_events_url":"https://api.github.com/users/Wardormeur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Wardormeur/cp-zen-platform","description":"This is the frontend repository of the CoderDojo Zen Community Platform project.","fork":true,"url":"https://api.github.com/repos/Wardormeur/cp-zen-platform","forks_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/forks","keys_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/teams","hooks_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/hooks","issue_events_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/events","assignees_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/tags","blobs_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/languages","stargazers_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/stargazers","contributors_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/contributors","subscribers_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/subscribers","subscription_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/subscription","commits_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/merges","archive_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/downloads","issues_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/labels{/name}","releases_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/releases{/id}","deployments_url":"https://api.github.com/repos/Wardormeur/cp-zen-platform/deployments","created_at":"2016-01-21T08:25:43Z","updated_at":"2016-01-21T08:25:45Z","pushed_at":"2016-09-06T08:48:29Z","git_url":"git://github.com/Wardormeur/cp-zen-platform.git","ssh_url":"git@github.com:Wardormeur/cp-zen-platform.git","clone_url":"https://github.com/Wardormeur/cp-zen-platform.git","svn_url":"https://github.com/Wardormeur/cp-zen-platform","homepage":"https://github.com/CoderDojo/community-platform","size":10887,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"CoderDojo:master","ref":"master","sha":"091ecb5c2fd38012d0aa49b6e7b214b88d3ab21b","user":{"login":"CoderDojo","id":1159537,"avatar_url":"https://avatars.githubusercontent.com/u/1159537?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderDojo","html_url":"https://github.com/CoderDojo","followers_url":"https://api.github.com/users/CoderDojo/followers","following_url":"https://api.github.com/users/CoderDojo/following{/other_user}","gists_url":"https://api.github.com/users/CoderDojo/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderDojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderDojo/subscriptions","organizations_url":"https://api.github.com/users/CoderDojo/orgs","repos_url":"https://api.github.com/users/CoderDojo/repos","events_url":"https://api.github.com/users/CoderDojo/events{/privacy}","received_events_url":"https://api.github.com/users/CoderDojo/received_events","type":"Organization","site_admin":false},"repo":{"id":32164706,"name":"cp-zen-platform","full_name":"CoderDojo/cp-zen-platform","owner":{"login":"CoderDojo","id":1159537,"avatar_url":"https://avatars.githubusercontent.com/u/1159537?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderDojo","html_url":"https://github.com/CoderDojo","followers_url":"https://api.github.com/users/CoderDojo/followers","following_url":"https://api.github.com/users/CoderDojo/following{/other_user}","gists_url":"https://api.github.com/users/CoderDojo/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderDojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderDojo/subscriptions","organizations_url":"https://api.github.com/users/CoderDojo/orgs","repos_url":"https://api.github.com/users/CoderDojo/repos","events_url":"https://api.github.com/users/CoderDojo/events{/privacy}","received_events_url":"https://api.github.com/users/CoderDojo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CoderDojo/cp-zen-platform","description":"This is the frontend repository of the CoderDojo Zen Community Platform project.","fork":false,"url":"https://api.github.com/repos/CoderDojo/cp-zen-platform","forks_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/forks","keys_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/teams","hooks_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/hooks","issue_events_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/events{/number}","events_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/events","assignees_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/assignees{/user}","branches_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/branches{/branch}","tags_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/tags","blobs_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/languages","stargazers_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/stargazers","contributors_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/contributors","subscribers_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/subscribers","subscription_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/subscription","commits_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/contents/{+path}","compare_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/merges","archive_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/downloads","issues_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues{/number}","pulls_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/labels{/name}","releases_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/releases{/id}","deployments_url":"https://api.github.com/repos/CoderDojo/cp-zen-platform/deployments","created_at":"2015-03-13T15:44:49Z","updated_at":"2016-09-01T13:58:13Z","pushed_at":"2016-09-06T08:48:30Z","git_url":"git://github.com/CoderDojo/cp-zen-platform.git","ssh_url":"git@github.com:CoderDojo/cp-zen-platform.git","clone_url":"https://github.com/CoderDojo/cp-zen-platform.git","svn_url":"https://github.com/CoderDojo/cp-zen-platform","homepage":"https://github.com/CoderDojo/community-platform","size":11227,"stargazers_count":16,"watchers_count":16,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":9,"forks":49,"open_issues":9,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994"},"html":{"href":"https://github.com/CoderDojo/cp-zen-platform/pull/994"},"issue":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/994"},"comments":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/issues/994/comments"},"review_comments":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994/comments"},"review_comment":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/pulls/994/commits"},"statuses":{"href":"https://api.github.com/repos/CoderDojo/cp-zen-platform/statuses/b8adff66778162e0146cd46bdb8b6f3871684b5b"}}}}
{"actor":{"display_login":"butlerx"}}