{"action":"created","comment":{"url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/comments/108982897","pull_request_review_id":30054486,"id":108982897,"diff_hunk":"@@ -1,14 +1,37 @@\n-import { getAllModels } from '../../lib/api-client';\n+import { getAllModels, patchItemDueDate, searchStudent } from '../../lib/api-client';\n import { Dispatcher } from 'consus-core/flux';\n-\n+import moment from 'moment-timezone';\n+import StudentStore from '../../store/student-store';\n export default class StudentPanelController {\n \n     static getModels() {\n         return getAllModels().then(models => {\n             Dispatcher.handleAction(\"MODELS_RECEIVED\", models);\n         });\n     }\n+    static changeItemDueDate(date, item){\n+        if(this.isValidDueDate(date)){\n+            return patchItemDueDate(date, item.address, StudentStore.getStudent().id).then(() => {\n+                return searchStudent(StudentStore.getStudent().id);\n+            }).then(student => {\n+                Dispatcher.handleAction(\"STUDENT_FOUND\", student);\n+            }).catch(e => {\n+                Dispatcher.handleAction('ERROR', { error: e.message });\n+            });\n+        }\n+    }\n \n+    static isValidDueDate(dueDate){\n+        let today = moment();\n+        let dueDateMoment = moment.tz(dueDate, 'America/Chicago');\n+        if(!dueDateMoment.isAfter(today)){\n+            Dispatcher.handleAction('ERROR', {\n+                error: 'Due date cannot be set to today or past.'","path":"src/controllers/components/student-panel.js","position":31,"original_position":31,"commit_id":"113bf7e52eb1171560236e17bf4cb0f6fb2dc089","original_commit_id":"113bf7e52eb1171560236e17bf4cb0f6fb2dc089","user":{"login":"gearedmonkey","id":6181818,"avatar_url":"https://avatars0.githubusercontent.com/u/6181818?v=3","gravatar_id":"","url":"https://api.github.com/users/gearedmonkey","html_url":"https://github.com/gearedmonkey","followers_url":"https://api.github.com/users/gearedmonkey/followers","following_url":"https://api.github.com/users/gearedmonkey/following{/other_user}","gists_url":"https://api.github.com/users/gearedmonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gearedmonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gearedmonkey/subscriptions","organizations_url":"https://api.github.com/users/gearedmonkey/orgs","repos_url":"https://api.github.com/users/gearedmonkey/repos","events_url":"https://api.github.com/users/gearedmonkey/events{/privacy}","received_events_url":"https://api.github.com/users/gearedmonkey/received_events","type":"User","site_admin":false},"body":"Burn.","created_at":"2017-03-30T17:10:06Z","updated_at":"2017-03-30T17:10:06Z","html_url":"https://github.com/TheFourFifths/consus-client/pull/122#discussion_r108982897","pull_request_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122","_links":{"self":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/comments/108982897"},"html":{"href":"https://github.com/TheFourFifths/consus-client/pull/122#discussion_r108982897"},"pull_request":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122","id":113466538,"html_url":"https://github.com/TheFourFifths/consus-client/pull/122","diff_url":"https://github.com/TheFourFifths/consus-client/pull/122.diff","patch_url":"https://github.com/TheFourFifths/consus-client/pull/122.patch","issue_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/122","number":122,"state":"open","locked":false,"title":"Edit duedate tff154","user":{"login":"gearedmonkey","id":6181818,"avatar_url":"https://avatars0.githubusercontent.com/u/6181818?v=3","gravatar_id":"","url":"https://api.github.com/users/gearedmonkey","html_url":"https://github.com/gearedmonkey","followers_url":"https://api.github.com/users/gearedmonkey/followers","following_url":"https://api.github.com/users/gearedmonkey/following{/other_user}","gists_url":"https://api.github.com/users/gearedmonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gearedmonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gearedmonkey/subscriptions","organizations_url":"https://api.github.com/users/gearedmonkey/orgs","repos_url":"https://api.github.com/users/gearedmonkey/repos","events_url":"https://api.github.com/users/gearedmonkey/events{/privacy}","received_events_url":"https://api.github.com/users/gearedmonkey/received_events","type":"User","site_admin":false},"body":"### Summary\r\n\r\nYou can now change the due date of an existing checkout\r\n\r\n### Checklist\r\n\r\n- [x] Have you added unit and functional tests as appropriate?\r\n- [x] Did you update/add documentation for new methods or changed functionality?\r\n- [x] Have you merged the target branch down into this one?\r\n\r\n### How to Review\r\n\r\n1. Start server on edit-duedate-tff154\r\n2. Lookup student 123456\r\n3. Checkout an item\r\n4. Complete item checkout\r\n5. Click change duedate button\r\n6. Verify date can only be in future\r\n7. Choose date.\r\n8. Verify date has changed in the panel.\r\n\r\n### Links\r\n\r\n- [TFF-154](https://msoese.atlassian.net/browse/TFF-154)\r\n- TheFourFifths/consus/pull/99\r\n","created_at":"2017-03-30T16:08:44Z","updated_at":"2017-03-30T17:10:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3eeacb25980147dd02cd613e3de1301a4250953","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122/commits","review_comments_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122/comments","review_comment_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/122/comments","statuses_url":"https://api.github.com/repos/TheFourFifths/consus-client/statuses/113bf7e52eb1171560236e17bf4cb0f6fb2dc089","head":{"label":"TheFourFifths:edit-duedate-tff154","ref":"edit-duedate-tff154","sha":"113bf7e52eb1171560236e17bf4cb0f6fb2dc089","user":{"login":"TheFourFifths","id":22348640,"avatar_url":"https://avatars3.githubusercontent.com/u/22348640?v=3","gravatar_id":"","url":"https://api.github.com/users/TheFourFifths","html_url":"https://github.com/TheFourFifths","followers_url":"https://api.github.com/users/TheFourFifths/followers","following_url":"https://api.github.com/users/TheFourFifths/following{/other_user}","gists_url":"https://api.github.com/users/TheFourFifths/gists{/gist_id}","starred_url":"https://api.github.com/users/TheFourFifths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheFourFifths/subscriptions","organizations_url":"https://api.github.com/users/TheFourFifths/orgs","repos_url":"https://api.github.com/users/TheFourFifths/repos","events_url":"https://api.github.com/users/TheFourFifths/events{/privacy}","received_events_url":"https://api.github.com/users/TheFourFifths/received_events","type":"Organization","site_admin":false},"repo":{"id":69761288,"name":"consus-client","full_name":"TheFourFifths/consus-client","owner":{"login":"TheFourFifths","id":22348640,"avatar_url":"https://avatars3.githubusercontent.com/u/22348640?v=3","gravatar_id":"","url":"https://api.github.com/users/TheFourFifths","html_url":"https://github.com/TheFourFifths","followers_url":"https://api.github.com/users/TheFourFifths/followers","following_url":"https://api.github.com/users/TheFourFifths/following{/other_user}","gists_url":"https://api.github.com/users/TheFourFifths/gists{/gist_id}","starred_url":"https://api.github.com/users/TheFourFifths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheFourFifths/subscriptions","organizations_url":"https://api.github.com/users/TheFourFifths/orgs","repos_url":"https://api.github.com/users/TheFourFifths/repos","events_url":"https://api.github.com/users/TheFourFifths/events{/privacy}","received_events_url":"https://api.github.com/users/TheFourFifths/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TheFourFifths/consus-client","description":"The Consus desktop application","fork":false,"url":"https://api.github.com/repos/TheFourFifths/consus-client","forks_url":"https://api.github.com/repos/TheFourFifths/consus-client/forks","keys_url":"https://api.github.com/repos/TheFourFifths/consus-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheFourFifths/consus-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheFourFifths/consus-client/teams","hooks_url":"https://api.github.com/repos/TheFourFifths/consus-client/hooks","issue_events_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/events{/number}","events_url":"https://api.github.com/repos/TheFourFifths/consus-client/events","assignees_url":"https://api.github.com/repos/TheFourFifths/consus-client/assignees{/user}","branches_url":"https://api.github.com/repos/TheFourFifths/consus-client/branches{/branch}","tags_url":"https://api.github.com/repos/TheFourFifths/consus-client/tags","blobs_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheFourFifths/consus-client/statuses/{sha}","languages_url":"https://api.github.com/repos/TheFourFifths/consus-client/languages","stargazers_url":"https://api.github.com/repos/TheFourFifths/consus-client/stargazers","contributors_url":"https://api.github.com/repos/TheFourFifths/consus-client/contributors","subscribers_url":"https://api.github.com/repos/TheFourFifths/consus-client/subscribers","subscription_url":"https://api.github.com/repos/TheFourFifths/consus-client/subscription","commits_url":"https://api.github.com/repos/TheFourFifths/consus-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheFourFifths/consus-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheFourFifths/consus-client/contents/{+path}","compare_url":"https://api.github.com/repos/TheFourFifths/consus-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheFourFifths/consus-client/merges","archive_url":"https://api.github.com/repos/TheFourFifths/consus-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheFourFifths/consus-client/downloads","issues_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues{/number}","pulls_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls{/number}","milestones_url":"https://api.github.com/repos/TheFourFifths/consus-client/milestones{/number}","notifications_url":"https://api.github.com/repos/TheFourFifths/consus-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheFourFifths/consus-client/labels{/name}","releases_url":"https://api.github.com/repos/TheFourFifths/consus-client/releases{/id}","deployments_url":"https://api.github.com/repos/TheFourFifths/consus-client/deployments","created_at":"2016-10-01T20:11:43Z","updated_at":"2017-01-22T17:32:26Z","pushed_at":"2017-03-30T16:09:27Z","git_url":"git://github.com/TheFourFifths/consus-client.git","ssh_url":"git@github.com:TheFourFifths/consus-client.git","clone_url":"https://github.com/TheFourFifths/consus-client.git","svn_url":"https://github.com/TheFourFifths/consus-client","homepage":null,"size":2098,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"dev"}},"base":{"label":"TheFourFifths:longterm-tff38-redo-story","ref":"longterm-tff38-redo-story","sha":"62ade3dcc5dd3e6dc348282a5ff8aa0255cb7574","user":{"login":"TheFourFifths","id":22348640,"avatar_url":"https://avatars3.githubusercontent.com/u/22348640?v=3","gravatar_id":"","url":"https://api.github.com/users/TheFourFifths","html_url":"https://github.com/TheFourFifths","followers_url":"https://api.github.com/users/TheFourFifths/followers","following_url":"https://api.github.com/users/TheFourFifths/following{/other_user}","gists_url":"https://api.github.com/users/TheFourFifths/gists{/gist_id}","starred_url":"https://api.github.com/users/TheFourFifths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheFourFifths/subscriptions","organizations_url":"https://api.github.com/users/TheFourFifths/orgs","repos_url":"https://api.github.com/users/TheFourFifths/repos","events_url":"https://api.github.com/users/TheFourFifths/events{/privacy}","received_events_url":"https://api.github.com/users/TheFourFifths/received_events","type":"Organization","site_admin":false},"repo":{"id":69761288,"name":"consus-client","full_name":"TheFourFifths/consus-client","owner":{"login":"TheFourFifths","id":22348640,"avatar_url":"https://avatars3.githubusercontent.com/u/22348640?v=3","gravatar_id":"","url":"https://api.github.com/users/TheFourFifths","html_url":"https://github.com/TheFourFifths","followers_url":"https://api.github.com/users/TheFourFifths/followers","following_url":"https://api.github.com/users/TheFourFifths/following{/other_user}","gists_url":"https://api.github.com/users/TheFourFifths/gists{/gist_id}","starred_url":"https://api.github.com/users/TheFourFifths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheFourFifths/subscriptions","organizations_url":"https://api.github.com/users/TheFourFifths/orgs","repos_url":"https://api.github.com/users/TheFourFifths/repos","events_url":"https://api.github.com/users/TheFourFifths/events{/privacy}","received_events_url":"https://api.github.com/users/TheFourFifths/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TheFourFifths/consus-client","description":"The Consus desktop application","fork":false,"url":"https://api.github.com/repos/TheFourFifths/consus-client","forks_url":"https://api.github.com/repos/TheFourFifths/consus-client/forks","keys_url":"https://api.github.com/repos/TheFourFifths/consus-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheFourFifths/consus-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheFourFifths/consus-client/teams","hooks_url":"https://api.github.com/repos/TheFourFifths/consus-client/hooks","issue_events_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/events{/number}","events_url":"https://api.github.com/repos/TheFourFifths/consus-client/events","assignees_url":"https://api.github.com/repos/TheFourFifths/consus-client/assignees{/user}","branches_url":"https://api.github.com/repos/TheFourFifths/consus-client/branches{/branch}","tags_url":"https://api.github.com/repos/TheFourFifths/consus-client/tags","blobs_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheFourFifths/consus-client/statuses/{sha}","languages_url":"https://api.github.com/repos/TheFourFifths/consus-client/languages","stargazers_url":"https://api.github.com/repos/TheFourFifths/consus-client/stargazers","contributors_url":"https://api.github.com/repos/TheFourFifths/consus-client/contributors","subscribers_url":"https://api.github.com/repos/TheFourFifths/consus-client/subscribers","subscription_url":"https://api.github.com/repos/TheFourFifths/consus-client/subscription","commits_url":"https://api.github.com/repos/TheFourFifths/consus-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheFourFifths/consus-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheFourFifths/consus-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheFourFifths/consus-client/contents/{+path}","compare_url":"https://api.github.com/repos/TheFourFifths/consus-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheFourFifths/consus-client/merges","archive_url":"https://api.github.com/repos/TheFourFifths/consus-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheFourFifths/consus-client/downloads","issues_url":"https://api.github.com/repos/TheFourFifths/consus-client/issues{/number}","pulls_url":"https://api.github.com/repos/TheFourFifths/consus-client/pulls{/number}","milestones_url":"https://api.github.com/repos/TheFourFifths/consus-client/milestones{/number}","notifications_url":"https://api.github.com/repos/TheFourFifths/consus-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheFourFifths/consus-client/labels{/name}","releases_url":"https://api.github.com/repos/TheFourFifths/consus-client/releases{/id}","deployments_url":"https://api.github.com/repos/TheFourFifths/consus-client/deployments","created_at":"2016-10-01T20:11:43Z","updated_at":"2017-01-22T17:32:26Z","pushed_at":"2017-03-30T16:09:27Z","git_url":"git://github.com/TheFourFifths/consus-client.git","ssh_url":"git@github.com:TheFourFifths/consus-client.git","clone_url":"https://github.com/TheFourFifths/consus-client.git","svn_url":"https://github.com/TheFourFifths/consus-client","homepage":null,"size":2098,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122"},"html":{"href":"https://github.com/TheFourFifths/consus-client/pull/122"},"issue":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/issues/122"},"comments":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/TheFourFifths/consus-client/statuses/113bf7e52eb1171560236e17bf4cb0f6fb2dc089"}}}}
{"actor":{"display_login":"gearedmonkey"}}