{"action":"created","comment":{"url":"https://api.github.com/repos/toggl/superday/pulls/comments/156301053","pull_request_review_id":82746549,"id":156301053,"diff_hunk":"@@ -78,41 +128,40 @@ class TimeslotDetailViewModel\n         }\n     }\n     \n-    private func filterSelectedElement(for date: Date) -> ([TimelineItem]) -> TimelineItem?\n+    private func filterSelectedElement(timelineItems: [TimelineItem]) -> TimelineItem?\n     {\n-        return { timelineItems in\n-            if self.isShowingSubSlot\n+        if self.isShowingSubSlot\n+        {\n+            var timeSlotToShow : TimeSlot!\n+            var isRunning = false\n+            \n+            for timeline in timelineItems\n             {\n-                var timeSlotToShow : TimeSlot!\n-                var isRunning = false\n-                \n-                for timeline in timelineItems\n+                if let timeSlot = timeline.timeSlots.filter({ $0.startTime == startDate }).first\n                 {\n-                    if let timeSlot = timeline.timeSlots.filter({ $0.startTime == date }).first\n+                    timeSlotToShow = timeSlot\n+                    let index = timeline.timeSlots.index(where: { $0.startTime == startDate })\n+                    if index == timeline.timeSlots.endIndex - 1\n                     {\n-                        timeSlotToShow = timeSlot\n-                        let index = timeline.timeSlots.index(where: { $0.startTime == date })\n-                        if index == timeline.timeSlots.endIndex - 1\n-                        {\n-                            isRunning = timeline.isRunning\n-                        }\n-                        break\n+                        isRunning = timeline.isRunning\n                     }\n+                    break\n                 }\n-\n-                guard timeSlotToShow != nil else { return nil }\n-                \n-                return TimelineItem(withTimeSlots: [timeSlotToShow],\n-                                    category: timeSlotToShow.category,\n-                                    duration: timeSlotToShow.duration != nil ?\n-                                        timeSlotToShow.duration! :\n-                                        self.timeService.now.timeIntervalSince(timeSlotToShow.startTime),\n-                                    isRunning: isRunning)\n-            }\n-            else\n-            {\n-                return timelineItems.filter({ $0.startTime == date }).first\n             }\n+\n+            guard timeSlotToShow != nil else { return nil }\n+            \n+            return TimelineItem(withTimeSlots: [timeSlotToShow],\n+                                category: timeSlotToShow.category,\n+                                duration: timeSlotToShow.duration != nil ?\n+                                    timeSlotToShow.duration! :\n+                                    self.timeService.now.timeIntervalSince(timeSlotToShow.startTime),\n+                                isRunning: isRunning)\n+        }\n+        else\n+        {\n+            print(startDate, #function)","path":"teferi/UI/Modules/Timeline/TimeSlotDetail/TimeslotDetailViewModel.swift","position":169,"original_position":169,"commit_id":"f58ba32f1ef31353e98cbf08177a6e6a7c8f0c59","original_commit_id":"f58ba32f1ef31353e98cbf08177a6e6a7c8f0c59","user":{"login":"Odrakir","id":724743,"avatar_url":"https://avatars2.githubusercontent.com/u/724743?v=4","gravatar_id":"","url":"https://api.github.com/users/Odrakir","html_url":"https://github.com/Odrakir","followers_url":"https://api.github.com/users/Odrakir/followers","following_url":"https://api.github.com/users/Odrakir/following{/other_user}","gists_url":"https://api.github.com/users/Odrakir/gists{/gist_id}","starred_url":"https://api.github.com/users/Odrakir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Odrakir/subscriptions","organizations_url":"https://api.github.com/users/Odrakir/orgs","repos_url":"https://api.github.com/users/Odrakir/repos","events_url":"https://api.github.com/users/Odrakir/events{/privacy}","received_events_url":"https://api.github.com/users/Odrakir/received_events","type":"User","site_admin":false},"body":"print","created_at":"2017-12-12T08:48:11Z","updated_at":"2017-12-12T09:01:04Z","html_url":"https://github.com/toggl/superday/pull/932#discussion_r156301053","pull_request_url":"https://api.github.com/repos/toggl/superday/pulls/932","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/toggl/superday/pulls/comments/156301053"},"html":{"href":"https://github.com/toggl/superday/pull/932#discussion_r156301053"},"pull_request":{"href":"https://api.github.com/repos/toggl/superday/pulls/932"}}},"pull_request":{"url":"https://api.github.com/repos/toggl/superday/pulls/932","id":156754576,"html_url":"https://github.com/toggl/superday/pull/932","diff_url":"https://github.com/toggl/superday/pull/932.diff","patch_url":"https://github.com/toggl/superday/pull/932.patch","issue_url":"https://api.github.com/repos/toggl/superday/issues/932","number":932,"state":"open","locked":false,"title":"Fix start time editing","user":{"login":"sofokli1","id":885122,"avatar_url":"https://avatars0.githubusercontent.com/u/885122?v=4","gravatar_id":"","url":"https://api.github.com/users/sofokli1","html_url":"https://github.com/sofokli1","followers_url":"https://api.github.com/users/sofokli1/followers","following_url":"https://api.github.com/users/sofokli1/following{/other_user}","gists_url":"https://api.github.com/users/sofokli1/gists{/gist_id}","starred_url":"https://api.github.com/users/sofokli1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofokli1/subscriptions","organizations_url":"https://api.github.com/users/sofokli1/orgs","repos_url":"https://api.github.com/users/sofokli1/repos","events_url":"https://api.github.com/users/sofokli1/events{/privacy}","received_events_url":"https://api.github.com/users/sofokli1/received_events","type":"User","site_admin":false},"body":"Closes #908 \r\n\r\nThis approach propagates the start time from the VC that the change happens down to the details view for grouped and single slot.\r\n\r\nAn other approach for this kind of issues would be to have identifiers per timeSlot. It seemed too big of a change for this PR but something worth thinking about.","created_at":"2017-12-06T15:10:49Z","updated_at":"2017-12-12T09:01:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81fc4880bfb5c146c750e8f9e78eb91317432cc1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/toggl/superday/pulls/932/commits","review_comments_url":"https://api.github.com/repos/toggl/superday/pulls/932/comments","review_comment_url":"https://api.github.com/repos/toggl/superday/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toggl/superday/issues/932/comments","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/f58ba32f1ef31353e98cbf08177a6e6a7c8f0c59","head":{"label":"toggl:fix-start-time-editing","ref":"fix-start-time-editing","sha":"f58ba32f1ef31353e98cbf08177a6e6a7c8f0c59","user":{"login":"toggl","id":316475,"avatar_url":"https://avatars3.githubusercontent.com/u/316475?v=4","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"repo":{"id":66841580,"name":"superday","full_name":"toggl/superday","owner":{"login":"toggl","id":316475,"avatar_url":"https://avatars3.githubusercontent.com/u/316475?v=4","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toggl/superday","description":"More time, more life.","fork":false,"url":"https://api.github.com/repos/toggl/superday","forks_url":"https://api.github.com/repos/toggl/superday/forks","keys_url":"https://api.github.com/repos/toggl/superday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toggl/superday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toggl/superday/teams","hooks_url":"https://api.github.com/repos/toggl/superday/hooks","issue_events_url":"https://api.github.com/repos/toggl/superday/issues/events{/number}","events_url":"https://api.github.com/repos/toggl/superday/events","assignees_url":"https://api.github.com/repos/toggl/superday/assignees{/user}","branches_url":"https://api.github.com/repos/toggl/superday/branches{/branch}","tags_url":"https://api.github.com/repos/toggl/superday/tags","blobs_url":"https://api.github.com/repos/toggl/superday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toggl/superday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toggl/superday/git/refs{/sha}","trees_url":"https://api.github.com/repos/toggl/superday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/{sha}","languages_url":"https://api.github.com/repos/toggl/superday/languages","stargazers_url":"https://api.github.com/repos/toggl/superday/stargazers","contributors_url":"https://api.github.com/repos/toggl/superday/contributors","subscribers_url":"https://api.github.com/repos/toggl/superday/subscribers","subscription_url":"https://api.github.com/repos/toggl/superday/subscription","commits_url":"https://api.github.com/repos/toggl/superday/commits{/sha}","git_commits_url":"https://api.github.com/repos/toggl/superday/git/commits{/sha}","comments_url":"https://api.github.com/repos/toggl/superday/comments{/number}","issue_comment_url":"https://api.github.com/repos/toggl/superday/issues/comments{/number}","contents_url":"https://api.github.com/repos/toggl/superday/contents/{+path}","compare_url":"https://api.github.com/repos/toggl/superday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toggl/superday/merges","archive_url":"https://api.github.com/repos/toggl/superday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toggl/superday/downloads","issues_url":"https://api.github.com/repos/toggl/superday/issues{/number}","pulls_url":"https://api.github.com/repos/toggl/superday/pulls{/number}","milestones_url":"https://api.github.com/repos/toggl/superday/milestones{/number}","notifications_url":"https://api.github.com/repos/toggl/superday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toggl/superday/labels{/name}","releases_url":"https://api.github.com/repos/toggl/superday/releases{/id}","deployments_url":"https://api.github.com/repos/toggl/superday/deployments","created_at":"2016-08-29T12:26:20Z","updated_at":"2017-12-11T02:30:09Z","pushed_at":"2017-12-11T15:32:45Z","git_url":"git://github.com/toggl/superday.git","ssh_url":"git@github.com:toggl/superday.git","clone_url":"https://github.com/toggl/superday.git","svn_url":"https://github.com/toggl/superday","homepage":"https://superday.toggl.com/","size":3129,"stargazers_count":23,"watchers_count":23,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":32,"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"},"forks":4,"open_issues":32,"watchers":23,"default_branch":"develop"}},"base":{"label":"toggl:develop","ref":"develop","sha":"c7eef999d2aded99981c59f01aa5ddf37ac6d48f","user":{"login":"toggl","id":316475,"avatar_url":"https://avatars3.githubusercontent.com/u/316475?v=4","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"repo":{"id":66841580,"name":"superday","full_name":"toggl/superday","owner":{"login":"toggl","id":316475,"avatar_url":"https://avatars3.githubusercontent.com/u/316475?v=4","gravatar_id":"","url":"https://api.github.com/users/toggl","html_url":"https://github.com/toggl","followers_url":"https://api.github.com/users/toggl/followers","following_url":"https://api.github.com/users/toggl/following{/other_user}","gists_url":"https://api.github.com/users/toggl/gists{/gist_id}","starred_url":"https://api.github.com/users/toggl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toggl/subscriptions","organizations_url":"https://api.github.com/users/toggl/orgs","repos_url":"https://api.github.com/users/toggl/repos","events_url":"https://api.github.com/users/toggl/events{/privacy}","received_events_url":"https://api.github.com/users/toggl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toggl/superday","description":"More time, more life.","fork":false,"url":"https://api.github.com/repos/toggl/superday","forks_url":"https://api.github.com/repos/toggl/superday/forks","keys_url":"https://api.github.com/repos/toggl/superday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toggl/superday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toggl/superday/teams","hooks_url":"https://api.github.com/repos/toggl/superday/hooks","issue_events_url":"https://api.github.com/repos/toggl/superday/issues/events{/number}","events_url":"https://api.github.com/repos/toggl/superday/events","assignees_url":"https://api.github.com/repos/toggl/superday/assignees{/user}","branches_url":"https://api.github.com/repos/toggl/superday/branches{/branch}","tags_url":"https://api.github.com/repos/toggl/superday/tags","blobs_url":"https://api.github.com/repos/toggl/superday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toggl/superday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toggl/superday/git/refs{/sha}","trees_url":"https://api.github.com/repos/toggl/superday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toggl/superday/statuses/{sha}","languages_url":"https://api.github.com/repos/toggl/superday/languages","stargazers_url":"https://api.github.com/repos/toggl/superday/stargazers","contributors_url":"https://api.github.com/repos/toggl/superday/contributors","subscribers_url":"https://api.github.com/repos/toggl/superday/subscribers","subscription_url":"https://api.github.com/repos/toggl/superday/subscription","commits_url":"https://api.github.com/repos/toggl/superday/commits{/sha}","git_commits_url":"https://api.github.com/repos/toggl/superday/git/commits{/sha}","comments_url":"https://api.github.com/repos/toggl/superday/comments{/number}","issue_comment_url":"https://api.github.com/repos/toggl/superday/issues/comments{/number}","contents_url":"https://api.github.com/repos/toggl/superday/contents/{+path}","compare_url":"https://api.github.com/repos/toggl/superday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toggl/superday/merges","archive_url":"https://api.github.com/repos/toggl/superday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toggl/superday/downloads","issues_url":"https://api.github.com/repos/toggl/superday/issues{/number}","pulls_url":"https://api.github.com/repos/toggl/superday/pulls{/number}","milestones_url":"https://api.github.com/repos/toggl/superday/milestones{/number}","notifications_url":"https://api.github.com/repos/toggl/superday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toggl/superday/labels{/name}","releases_url":"https://api.github.com/repos/toggl/superday/releases{/id}","deployments_url":"https://api.github.com/repos/toggl/superday/deployments","created_at":"2016-08-29T12:26:20Z","updated_at":"2017-12-11T02:30:09Z","pushed_at":"2017-12-11T15:32:45Z","git_url":"git://github.com/toggl/superday.git","ssh_url":"git@github.com:toggl/superday.git","clone_url":"https://github.com/toggl/superday.git","svn_url":"https://github.com/toggl/superday","homepage":"https://superday.toggl.com/","size":3129,"stargazers_count":23,"watchers_count":23,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":32,"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"},"forks":4,"open_issues":32,"watchers":23,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/toggl/superday/pulls/932"},"html":{"href":"https://github.com/toggl/superday/pull/932"},"issue":{"href":"https://api.github.com/repos/toggl/superday/issues/932"},"comments":{"href":"https://api.github.com/repos/toggl/superday/issues/932/comments"},"review_comments":{"href":"https://api.github.com/repos/toggl/superday/pulls/932/comments"},"review_comment":{"href":"https://api.github.com/repos/toggl/superday/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toggl/superday/pulls/932/commits"},"statuses":{"href":"https://api.github.com/repos/toggl/superday/statuses/f58ba32f1ef31353e98cbf08177a6e6a7c8f0c59"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Odrakir"}}