{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/comments/87059489","pull_request_review_id":7686579,"id":87059489,"diff_hunk":"@@ -0,0 +1,144 @@\n+/**\n+ * TimePeriod.jsx\n+ * Created by Emily Gullo 11/03/2016\n+ **/\n+\n+import React from 'react';\n+import moment from 'moment';\n+import DateRange from './DateRange';\n+import FiscalYear from './FiscalYear';\n+\n+const defaultProps = {\n+    timePeriods: [\n+        '2016',\n+        '2015',\n+        '2014',\n+        '2013',\n+        '2012',\n+        '2011',\n+        '2010',\n+        '2009'\n+    ]\n+};\n+\n+const propTypes = {\n+    timePeriods: React.PropTypes.array,\n+    label: React.PropTypes.string\n+};\n+\n+export default class TimePeriod extends React.Component {\n+\n+    constructor(props) {\n+        super(props);\n+\n+        this.state = {\n+            startDate: null,\n+            endDate: null,\n+            error: {\n+                show: false,\n+                header: '',\n+                description: ''\n+            },\n+            errorDetails: \"\"\n+        };\n+    }\n+\n+    handleDateChange(date, dateType) {\n+    // merge the new date into the file's state without affecting the other keys\n+        this.setState({\n+            [dateType]: moment(date)\n+        }, () => {\n+            this.validateDates();\n+        });\n+    }\n+\n+    validateDates() {\n+        // validate that dates are provided for both fields and the end dates\n+        // don't come before the start dates\n+\n+        const err = Object.assign({}, this.state);\n+\n+        const output = {\n+            error: err\n+        };\n+\n+        // validate the date ranges\n+        const start = this.state.startDate;\n+        const end = this.state.endDate;\n+        if (start && end) {\n+            // both sets of dates exist\n+            if (!end.isSameOrAfter(start)) {\n+                // end date comes before start date, invalid\n+                // show an error message\n+                output.error = {\n+                    show: true,\n+                    header: 'Invalid Dates',\n+                    description: 'The end date cannot be earlier than the start date.'\n+                };\n+            }\n+            else {\n+                // valid!\n+                output.error = {\n+                    show: false,\n+                    header: '',\n+                    description: ''\n+                };\n+            }\n+        }\n+        else {\n+            // not all dates exist yet\n+            output.error = {\n+                show: false,\n+                header: '',\n+                description: ''\n+            };\n+        }\n+\n+        this.setState(output);\n+    }\n+\n+    showError(head, desc) {","path":"src/js/components/search/filters/timePeriod/TimePeriod.jsx","position":100,"original_position":100,"commit_id":"627363712559ad67104ed7168831d16fdee79525","original_commit_id":"627363712559ad67104ed7168831d16fdee79525","user":{"login":"kevinli-work","id":3594363,"avatar_url":"https://avatars.githubusercontent.com/u/3594363?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinli-work","html_url":"https://github.com/kevinli-work","followers_url":"https://api.github.com/users/kevinli-work/followers","following_url":"https://api.github.com/users/kevinli-work/following{/other_user}","gists_url":"https://api.github.com/users/kevinli-work/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinli-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinli-work/subscriptions","organizations_url":"https://api.github.com/users/kevinli-work/orgs","repos_url":"https://api.github.com/users/kevinli-work/repos","events_url":"https://api.github.com/users/kevinli-work/events{/privacy}","received_events_url":"https://api.github.com/users/kevinli-work/received_events","type":"User","site_admin":false},"body":"So.............what does `showError` and `hideError` actually do?","created_at":"2016-11-08T19:02:52Z","updated_at":"2016-11-08T19:08:37Z","html_url":"https://github.com/fedspendingtransparency/usaspending-website/pull/5#discussion_r87059489","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/comments/87059489"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-website/pull/5#discussion_r87059489"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5","id":92597293,"html_url":"https://github.com/fedspendingtransparency/usaspending-website/pull/5","diff_url":"https://github.com/fedspendingtransparency/usaspending-website/pull/5.diff","patch_url":"https://github.com/fedspendingtransparency/usaspending-website/pull/5.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/5","number":5,"state":"open","locked":false,"title":"Feature search ui","user":{"login":"ejgullo","id":19807146,"avatar_url":"https://avatars.githubusercontent.com/u/19807146?v=3","gravatar_id":"","url":"https://api.github.com/users/ejgullo","html_url":"https://github.com/ejgullo","followers_url":"https://api.github.com/users/ejgullo/followers","following_url":"https://api.github.com/users/ejgullo/following{/other_user}","gists_url":"https://api.github.com/users/ejgullo/gists{/gist_id}","starred_url":"https://api.github.com/users/ejgullo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejgullo/subscriptions","organizations_url":"https://api.github.com/users/ejgullo/orgs","repos_url":"https://api.github.com/users/ejgullo/repos","events_url":"https://api.github.com/users/ejgullo/events{/privacy}","received_events_url":"https://api.github.com/users/ejgullo/received_events","type":"User","site_admin":false},"body":"-DS-396, 397\r\n- Bug fixes as per email\r\n- Restructuring render in Primary Awards to lighten render\r\n- Adding Fiscal Year UI components\r\n- Linter fixes across search UI components","created_at":"2016-11-07T14:54:32Z","updated_at":"2016-11-08T19:08:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00fd9c80d74173adfb8d8cfbb35942709fab753a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/5/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/statuses/627363712559ad67104ed7168831d16fdee79525","head":{"label":"fedspendingtransparency:feature-search-ui","ref":"feature-search-ui","sha":"627363712559ad67104ed7168831d16fdee79525","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394770,"name":"usaspending-website","full_name":"fedspendingtransparency/usaspending-website","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-website","description":null,"fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/deployments","created_at":"2016-08-10T15:39:03Z","updated_at":"2016-11-04T22:05:33Z","pushed_at":"2016-11-08T18:51:32Z","git_url":"git://github.com/fedspendingtransparency/usaspending-website.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-website.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-website.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-website","homepage":null,"size":831,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"dev"}},"base":{"label":"fedspendingtransparency:dev","ref":"dev","sha":"f3f2bd7ff17bcbcfd02e10f8c5b58715e137d148","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":65394770,"name":"usaspending-website","full_name":"fedspendingtransparency/usaspending-website","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/usaspending-website","description":null,"fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/deployments","created_at":"2016-08-10T15:39:03Z","updated_at":"2016-11-04T22:05:33Z","pushed_at":"2016-11-08T18:51:32Z","git_url":"git://github.com/fedspendingtransparency/usaspending-website.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-website.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-website.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-website","homepage":null,"size":831,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-website/pull/5"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/5"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-website/statuses/627363712559ad67104ed7168831d16fdee79525"}}}}
{"actor":{"display_login":"kevinli-work"}}