{"action":"created","comment":{"url":"https://api.github.com/repos/indico/indico-plugins/pulls/comments/63839986","id":63839986,"diff_hunk":"@@ -36,3 +43,75 @@ def _process(self):\n         with plugin.plugin_context():\n             data = {'records': importer.import_data(query, size)}\n         return jsonify(data)\n+\n+\n+class RHEndTimeBase(RHManageTimetableBase):\n+    \"\"\"Base class for the importer operations\"\"\"\n+    normalize_url_spec = {\n+        'locators': {\n+            lambda self: self.event_new\n+        },\n+        'preserved_args': {\n+            'importer_name'\n+        }\n+    }\n+\n+    @staticmethod\n+    def _find_latest_end_dt(entries):\n+        latest_dt = None\n+        for entry in entries:\n+            if latest_dt is None or entry.end_dt > latest_dt:\n+                latest_dt = entry.end_dt\n+        return latest_dt\n+\n+    def _format_date(self, date):\n+        return date.astimezone(timezone(self.event_new.timezone)).strftime('%H:%M')\n+\n+\n+class RHDayEndTime(RHEndTimeBase):\n+    \"\"\"Get the end_dt of the latest timetable entry or the event start_dt if no entry exist on that date\"\"\"\n+\n+    def _checkParams(self, params):\n+        RHEndTimeBase._checkParams(self, params)\n+        self.date = timezone(self.event_new.timezone).localize(datetime.strptime(request.args['selectedDay'],\n+                                                                                 '%Y/%m/%d'))\n+\n+    def _process(self):\n+        end_date = self.date + relativedelta(days=1)\n+        entries = self.event_new.timetable_entries.filter(TimetableEntry.start_dt >= self.date,","path":"importer/indico_importer/controllers.py","position":56,"original_position":56,"commit_id":"cb09901092b4655c38344923615a2adab893e9bb","original_commit_id":"cb09901092b4655c38344923615a2adab893e9bb","user":{"login":"ThiefMaster","id":179599,"avatar_url":"https://avatars.githubusercontent.com/u/179599?v=3","gravatar_id":"","url":"https://api.github.com/users/ThiefMaster","html_url":"https://github.com/ThiefMaster","followers_url":"https://api.github.com/users/ThiefMaster/followers","following_url":"https://api.github.com/users/ThiefMaster/following{/other_user}","gists_url":"https://api.github.com/users/ThiefMaster/gists{/gist_id}","starred_url":"https://api.github.com/users/ThiefMaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThiefMaster/subscriptions","organizations_url":"https://api.github.com/users/ThiefMaster/orgs","repos_url":"https://api.github.com/users/ThiefMaster/repos","events_url":"https://api.github.com/users/ThiefMaster/events{/privacy}","received_events_url":"https://api.github.com/users/ThiefMaster/received_events","type":"User","site_admin":false},"body":"`self.date` is in the event timezone but the columns are in utc. You probably need `TimetableEntry.start_dt.astimezone(self.event_new.tzinfo)`","created_at":"2016-05-19T08:29:02Z","updated_at":"2016-05-19T08:29:02Z","html_url":"https://github.com/indico/indico-plugins/pull/28#discussion_r63839986","pull_request_url":"https://api.github.com/repos/indico/indico-plugins/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/comments/63839986"},"html":{"href":"https://github.com/indico/indico-plugins/pull/28#discussion_r63839986"},"pull_request":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/indico/indico-plugins/pulls/28","id":69455836,"html_url":"https://github.com/indico/indico-plugins/pull/28","diff_url":"https://github.com/indico/indico-plugins/pull/28.diff","patch_url":"https://github.com/indico/indico-plugins/pull/28.patch","issue_url":"https://api.github.com/repos/indico/indico-plugins/issues/28","number":28,"state":"open","locked":false,"title":"Adapt importer to new timetable","user":{"login":"florv","id":2007047,"avatar_url":"https://avatars.githubusercontent.com/u/2007047?v=3","gravatar_id":"","url":"https://api.github.com/users/florv","html_url":"https://github.com/florv","followers_url":"https://api.github.com/users/florv/followers","following_url":"https://api.github.com/users/florv/following{/other_user}","gists_url":"https://api.github.com/users/florv/gists{/gist_id}","starred_url":"https://api.github.com/users/florv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florv/subscriptions","organizations_url":"https://api.github.com/users/florv/orgs","repos_url":"https://api.github.com/users/florv/repos","events_url":"https://api.github.com/users/florv/events{/privacy}","received_events_url":"https://api.github.com/users/florv/received_events","type":"User","site_admin":false},"body":"Same as #27 but against master instead of devel.","created_at":"2016-05-10T06:42:37Z","updated_at":"2016-05-19T08:29:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1df4cc970b8cd33d2b90d5d31525418cc723efa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/indico/indico-plugins/pulls/28/commits","review_comments_url":"https://api.github.com/repos/indico/indico-plugins/pulls/28/comments","review_comment_url":"https://api.github.com/repos/indico/indico-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indico/indico-plugins/issues/28/comments","statuses_url":"https://api.github.com/repos/indico/indico-plugins/statuses/cb09901092b4655c38344923615a2adab893e9bb","head":{"label":"florv:timetable","ref":"timetable","sha":"cb09901092b4655c38344923615a2adab893e9bb","user":{"login":"florv","id":2007047,"avatar_url":"https://avatars.githubusercontent.com/u/2007047?v=3","gravatar_id":"","url":"https://api.github.com/users/florv","html_url":"https://github.com/florv","followers_url":"https://api.github.com/users/florv/followers","following_url":"https://api.github.com/users/florv/following{/other_user}","gists_url":"https://api.github.com/users/florv/gists{/gist_id}","starred_url":"https://api.github.com/users/florv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florv/subscriptions","organizations_url":"https://api.github.com/users/florv/orgs","repos_url":"https://api.github.com/users/florv/repos","events_url":"https://api.github.com/users/florv/events{/privacy}","received_events_url":"https://api.github.com/users/florv/received_events","type":"User","site_admin":false},"repo":{"id":50830201,"name":"indico-plugins","full_name":"florv/indico-plugins","owner":{"login":"florv","id":2007047,"avatar_url":"https://avatars.githubusercontent.com/u/2007047?v=3","gravatar_id":"","url":"https://api.github.com/users/florv","html_url":"https://github.com/florv","followers_url":"https://api.github.com/users/florv/followers","following_url":"https://api.github.com/users/florv/following{/other_user}","gists_url":"https://api.github.com/users/florv/gists{/gist_id}","starred_url":"https://api.github.com/users/florv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florv/subscriptions","organizations_url":"https://api.github.com/users/florv/orgs","repos_url":"https://api.github.com/users/florv/repos","events_url":"https://api.github.com/users/florv/events{/privacy}","received_events_url":"https://api.github.com/users/florv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/florv/indico-plugins","description":"Indico plugins developed by the Indico team","fork":true,"url":"https://api.github.com/repos/florv/indico-plugins","forks_url":"https://api.github.com/repos/florv/indico-plugins/forks","keys_url":"https://api.github.com/repos/florv/indico-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/florv/indico-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/florv/indico-plugins/teams","hooks_url":"https://api.github.com/repos/florv/indico-plugins/hooks","issue_events_url":"https://api.github.com/repos/florv/indico-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/florv/indico-plugins/events","assignees_url":"https://api.github.com/repos/florv/indico-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/florv/indico-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/florv/indico-plugins/tags","blobs_url":"https://api.github.com/repos/florv/indico-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/florv/indico-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/florv/indico-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/florv/indico-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/florv/indico-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/florv/indico-plugins/languages","stargazers_url":"https://api.github.com/repos/florv/indico-plugins/stargazers","contributors_url":"https://api.github.com/repos/florv/indico-plugins/contributors","subscribers_url":"https://api.github.com/repos/florv/indico-plugins/subscribers","subscription_url":"https://api.github.com/repos/florv/indico-plugins/subscription","commits_url":"https://api.github.com/repos/florv/indico-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/florv/indico-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/florv/indico-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/florv/indico-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/florv/indico-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/florv/indico-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/florv/indico-plugins/merges","archive_url":"https://api.github.com/repos/florv/indico-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/florv/indico-plugins/downloads","issues_url":"https://api.github.com/repos/florv/indico-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/florv/indico-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/florv/indico-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/florv/indico-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/florv/indico-plugins/labels{/name}","releases_url":"https://api.github.com/repos/florv/indico-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/florv/indico-plugins/deployments","created_at":"2016-02-01T09:51:22Z","updated_at":"2016-02-01T09:51:23Z","pushed_at":"2016-05-17T14:43:56Z","git_url":"git://github.com/florv/indico-plugins.git","ssh_url":"git@github.com:florv/indico-plugins.git","clone_url":"https://github.com/florv/indico-plugins.git","svn_url":"https://github.com/florv/indico-plugins","homepage":null,"size":2835,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"indico:master","ref":"master","sha":"ae9be2ebb4fb3ee22e9168d55f95f34ffc7f6a3c","user":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"repo":{"id":26865883,"name":"indico-plugins","full_name":"indico/indico-plugins","owner":{"login":"indico","id":715236,"avatar_url":"https://avatars.githubusercontent.com/u/715236?v=3","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/indico/indico-plugins","description":"Indico plugins developed by the Indico team","fork":false,"url":"https://api.github.com/repos/indico/indico-plugins","forks_url":"https://api.github.com/repos/indico/indico-plugins/forks","keys_url":"https://api.github.com/repos/indico/indico-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indico/indico-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indico/indico-plugins/teams","hooks_url":"https://api.github.com/repos/indico/indico-plugins/hooks","issue_events_url":"https://api.github.com/repos/indico/indico-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/indico/indico-plugins/events","assignees_url":"https://api.github.com/repos/indico/indico-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/indico/indico-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/indico/indico-plugins/tags","blobs_url":"https://api.github.com/repos/indico/indico-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indico/indico-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indico/indico-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/indico/indico-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indico/indico-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/indico/indico-plugins/languages","stargazers_url":"https://api.github.com/repos/indico/indico-plugins/stargazers","contributors_url":"https://api.github.com/repos/indico/indico-plugins/contributors","subscribers_url":"https://api.github.com/repos/indico/indico-plugins/subscribers","subscription_url":"https://api.github.com/repos/indico/indico-plugins/subscription","commits_url":"https://api.github.com/repos/indico/indico-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/indico/indico-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/indico/indico-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/indico/indico-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/indico/indico-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/indico/indico-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indico/indico-plugins/merges","archive_url":"https://api.github.com/repos/indico/indico-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indico/indico-plugins/downloads","issues_url":"https://api.github.com/repos/indico/indico-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/indico/indico-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/indico/indico-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/indico/indico-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indico/indico-plugins/labels{/name}","releases_url":"https://api.github.com/repos/indico/indico-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/indico/indico-plugins/deployments","created_at":"2014-11-19T14:48:42Z","updated_at":"2016-01-25T12:35:01Z","pushed_at":"2016-05-17T14:43:56Z","git_url":"git://github.com/indico/indico-plugins.git","ssh_url":"git@github.com:indico/indico-plugins.git","clone_url":"https://github.com/indico/indico-plugins.git","svn_url":"https://github.com/indico/indico-plugins","homepage":null,"size":2861,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":7,"forks":7,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/28"},"html":{"href":"https://github.com/indico/indico-plugins/pull/28"},"issue":{"href":"https://api.github.com/repos/indico/indico-plugins/issues/28"},"comments":{"href":"https://api.github.com/repos/indico/indico-plugins/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indico/indico-plugins/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/indico/indico-plugins/statuses/cb09901092b4655c38344923615a2adab893e9bb"}}}}