{"action":"created","comment":{"url":"https://api.github.com/repos/Talend/ui/pulls/comments/205120147","pull_request_review_id":140325822,"id":205120147,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTEyMDE0Nw==","diff_hunk":"@@ -0,0 +1,221 @@\n+import React from 'react';\n+import PropTypes from 'prop-types';\n+\n+import getMinutes from 'date-fns/get_minutes';\n+import getHours from 'date-fns/get_hours';\n+import getDate from 'date-fns/get_date';\n+import getMonth from 'date-fns/get_month';\n+import getYear from 'date-fns/get_year';\n+import setDate from 'date-fns/set_date';\n+import setMinutes from 'date-fns/set_minutes';\n+import lastDayOfMonth from 'date-fns/last_day_of_month';\n+import { twoDigits } from '../pickers/TimePicker';\n+import DateTimePicker from '../DateTimePicker';\n+import theme from './InputDateTimePicker.scss';\n+\n+const splitDateAndTimeRegex = new RegExp(/^(.*),(.*)$/);\n+const dateRegex = new RegExp(/^\\s*([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})\\s*$/);\n+const timeRegex = new RegExp(/^\\s*([0-9]{1,2}):([0-9]{2})\\s*$/);\n+\n+function hoursAndMinutesToTime(hours, minutes) {\n+\treturn hours * 60 + minutes;\n+}\n+\n+function getTextDate(date, time) {\n+\tif (date === undefined) {\n+\t\treturn '';\n+\t}\n+\n+\tconst day = getDate(date);\n+\tconst month = getMonth(date) + 1;\n+\tconst year = getYear(date);\n+\n+\tconst dateText = `${twoDigits(day)}/${twoDigits(month)}/${year}`;\n+\n+\tif (time === undefined) {\n+\t\treturn dateText;\n+\t}\n+\n+\tconst hours = Math.floor(time / 60);\n+\tconst minutes = time % 60;\n+\n+\tconst timeText = `, ${twoDigits(hours)}:${twoDigits(minutes)}`;\n+\n+\treturn dateText + timeText;\n+}\n+\n+\n+class InputDateTimePicker extends React.Component {\n+\tstatic propTypes = {\n+\t\tselectedDateTime: PropTypes.instanceOf(Date),\n+\t\tonChange: PropTypes.func.isRequired,\n+\t};\n+\n+\tconstructor(props) {\n+\t\tsuper(props);\n+\n+\t\tthis.state = (() => {\n+\t\t\tconst selectedDateTime = this.props.selectedDateTime;\n+\t\t\tif (selectedDateTime !== undefined) {\n+\t\t\t\tconst date = selectedDateTime;\n+\t\t\t\tconst hours = getHours(selectedDateTime);\n+\t\t\t\tconst minutes = getMinutes(selectedDateTime);\n+\t\t\t\tconst time = hoursAndMinutesToTime(hours, minutes);\n+\t\t\t\treturn {\n+\t\t\t\t\tdate,\n+\t\t\t\t\ttime,\n+\t\t\t\t\ttextInput: getTextDate(date, time),\n+\t\t\t\t};\n+\t\t\t}\n+\n+\t\t\treturn {\n+\t\t\t\ttextInput: '',\n+\t\t\t};\n+\t\t})();\n+\n+\t\tthis.onChangeInput = this.onChangeInput.bind(this);\n+\t\tthis.onSubmitPicker = this.onSubmitPicker.bind(this);\n+\t}\n+\n+\tonSubmitPicker({ date, time }) {\n+\t\tthis.updateDateTime(date, time);\n+\t}\n+\n+\tonChangeInput(event) {\n+\t\tconst text = event.target.value;\n+\n+\t\tconst splitMatches = text.match(splitDateAndTimeRegex);\n+\n+\t\tif (!splitMatches) {\n+\t\t\tconsole.warn('DATETIME - INCORRECT FORMAT:', text);","path":"packages/components/src/DateTimePickers/InputDateTimePicker/InputDateTimePicker.component.js","position":90,"original_position":90,"commit_id":"bc633c8c801868ad679d0eef87237aad17b24369","original_commit_id":"bc633c8c801868ad679d0eef87237aad17b24369","user":{"login":"jdescottes-talend","id":38074242,"node_id":"MDQ6VXNlcjM4MDc0MjQy","avatar_url":"https://avatars1.githubusercontent.com/u/38074242?v=4","gravatar_id":"","url":"https://api.github.com/users/jdescottes-talend","html_url":"https://github.com/jdescottes-talend","followers_url":"https://api.github.com/users/jdescottes-talend/followers","following_url":"https://api.github.com/users/jdescottes-talend/following{/other_user}","gists_url":"https://api.github.com/users/jdescottes-talend/gists{/gist_id}","starred_url":"https://api.github.com/users/jdescottes-talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdescottes-talend/subscriptions","organizations_url":"https://api.github.com/users/jdescottes-talend/orgs","repos_url":"https://api.github.com/users/jdescottes-talend/repos","events_url":"https://api.github.com/users/jdescottes-talend/events{/privacy}","received_events_url":"https://api.github.com/users/jdescottes-talend/received_events","type":"User","site_admin":false},"body":"✔","created_at":"2018-07-25T14:01:02Z","updated_at":"2018-07-25T14:01:02Z","html_url":"https://github.com/Talend/ui/pull/1538#discussion_r205120147","pull_request_url":"https://api.github.com/repos/Talend/ui/pulls/1538","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Talend/ui/pulls/comments/205120147"},"html":{"href":"https://github.com/Talend/ui/pull/1538#discussion_r205120147"},"pull_request":{"href":"https://api.github.com/repos/Talend/ui/pulls/1538"}},"in_reply_to_id":204420027},"pull_request":{"url":"https://api.github.com/repos/Talend/ui/pulls/1538","id":201229422,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMjI5NDIy","html_url":"https://github.com/Talend/ui/pull/1538","diff_url":"https://github.com/Talend/ui/pull/1538.diff","patch_url":"https://github.com/Talend/ui/pull/1538.patch","issue_url":"https://api.github.com/repos/Talend/ui/issues/1538","number":1538,"state":"open","locked":false,"title":"feat(component/step6): input integration with picker","user":{"login":"jdescottes-talend","id":38074242,"node_id":"MDQ6VXNlcjM4MDc0MjQy","avatar_url":"https://avatars1.githubusercontent.com/u/38074242?v=4","gravatar_id":"","url":"https://api.github.com/users/jdescottes-talend","html_url":"https://github.com/jdescottes-talend","followers_url":"https://api.github.com/users/jdescottes-talend/followers","following_url":"https://api.github.com/users/jdescottes-talend/following{/other_user}","gists_url":"https://api.github.com/users/jdescottes-talend/gists{/gist_id}","starred_url":"https://api.github.com/users/jdescottes-talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdescottes-talend/subscriptions","organizations_url":"https://api.github.com/users/jdescottes-talend/orgs","repos_url":"https://api.github.com/users/jdescottes-talend/repos","events_url":"https://api.github.com/users/jdescottes-talend/events{/privacy}","received_events_url":"https://api.github.com/users/jdescottes-talend/received_events","type":"User","site_admin":false},"body":"**What is the problem this PR is trying to solve?**\r\nIntegrate the picker with the input and synchronize the two.\r\n\r\n**What is the chosen solution to this problem?**\r\nImplement a new component for wrapping the picker and adding the input logic\r\n\r\n**Please check if the PR fulfills these requirements**\r\n\r\n* [x] The PR commit message follows our [guidelines](https://github.com/talend/tools/blob/master/tools-root-github/CONTRIBUTING.md)\r\n* [x] Tests for the changes have been added (for bug fixes / features) And [non reg](./screenshots.md) done before need review\r\n* [ ] Docs have been added / updated (for bug fixes / features)\r\n* [ ] Related design / discussions / pages (not in jira), if any, are all linked or available in the PR\r\n\r\n<!-- You can add more checkboxes here -->\r\n\r\n**[ ] This PR introduces a breaking change**\r\n\r\n<!-- if the PR introduces a breaking change, add the description here. So when you merge this PR, add this description into the [breaking change wiki](https://github.com/Talend/ui/wiki/BREAKING-CHANGE) in the next version -->\r\n\r\n<!-- **Original Template** -->\r\n\r\n<!-- https://github.com/Talend/tools/blob/master/tools-root-github/.github/PULL_REQUEST_TEMPLATE.md -->\r\n","created_at":"2018-07-13T09:04:17Z","updated_at":"2018-07-25T14:01:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdf75c21235dea09ec2910219e19b3fc4a864eed","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jmfrancois","id":19857479,"node_id":"MDQ6VXNlcjE5ODU3NDc5","avatar_url":"https://avatars2.githubusercontent.com/u/19857479?v=4","gravatar_id":"","url":"https://api.github.com/users/jmfrancois","html_url":"https://github.com/jmfrancois","followers_url":"https://api.github.com/users/jmfrancois/followers","following_url":"https://api.github.com/users/jmfrancois/following{/other_user}","gists_url":"https://api.github.com/users/jmfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/jmfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmfrancois/subscriptions","organizations_url":"https://api.github.com/users/jmfrancois/orgs","repos_url":"https://api.github.com/users/jmfrancois/repos","events_url":"https://api.github.com/users/jmfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/jmfrancois/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Talend/ui/pulls/1538/commits","review_comments_url":"https://api.github.com/repos/Talend/ui/pulls/1538/comments","review_comment_url":"https://api.github.com/repos/Talend/ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Talend/ui/issues/1538/comments","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/bc633c8c801868ad679d0eef87237aad17b24369","head":{"label":"Talend:jdescottes/feat/date-picker_integration","ref":"jdescottes/feat/date-picker_integration","sha":"bc633c8c801868ad679d0eef87237aad17b24369","user":{"login":"Talend","id":459687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1OTY4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":79343946,"node_id":"MDEwOlJlcG9zaXRvcnk3OTM0Mzk0Ng==","name":"ui","full_name":"Talend/ui","owner":{"login":"Talend","id":459687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1OTY4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/ui","description":"Talend's unified web UI repository.","fork":false,"url":"https://api.github.com/repos/Talend/ui","forks_url":"https://api.github.com/repos/Talend/ui/forks","keys_url":"https://api.github.com/repos/Talend/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/ui/teams","hooks_url":"https://api.github.com/repos/Talend/ui/hooks","issue_events_url":"https://api.github.com/repos/Talend/ui/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/ui/events","assignees_url":"https://api.github.com/repos/Talend/ui/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/ui/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/ui/tags","blobs_url":"https://api.github.com/repos/Talend/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/ui/languages","stargazers_url":"https://api.github.com/repos/Talend/ui/stargazers","contributors_url":"https://api.github.com/repos/Talend/ui/contributors","subscribers_url":"https://api.github.com/repos/Talend/ui/subscribers","subscription_url":"https://api.github.com/repos/Talend/ui/subscription","commits_url":"https://api.github.com/repos/Talend/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/ui/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/ui/merges","archive_url":"https://api.github.com/repos/Talend/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/ui/downloads","issues_url":"https://api.github.com/repos/Talend/ui/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/ui/labels{/name}","releases_url":"https://api.github.com/repos/Talend/ui/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/ui/deployments","created_at":"2017-01-18T13:45:58Z","updated_at":"2018-07-24T12:30:44Z","pushed_at":"2018-07-25T13:54:47Z","git_url":"git://github.com/Talend/ui.git","ssh_url":"git@github.com:Talend/ui.git","clone_url":"https://github.com/Talend/ui.git","svn_url":"https://github.com/Talend/ui","homepage":"http://talend.surge.sh","size":30449,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":52,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":19,"open_issues":52,"watchers":57,"default_branch":"master"}},"base":{"label":"Talend:jdescottes/feat/date-picker","ref":"jdescottes/feat/date-picker","sha":"36f0ace46b34ae8459533115ff6ca2d81a03de19","user":{"login":"Talend","id":459687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1OTY4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"repo":{"id":79343946,"node_id":"MDEwOlJlcG9zaXRvcnk3OTM0Mzk0Ng==","name":"ui","full_name":"Talend/ui","owner":{"login":"Talend","id":459687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ1OTY4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/459687?v=4","gravatar_id":"","url":"https://api.github.com/users/Talend","html_url":"https://github.com/Talend","followers_url":"https://api.github.com/users/Talend/followers","following_url":"https://api.github.com/users/Talend/following{/other_user}","gists_url":"https://api.github.com/users/Talend/gists{/gist_id}","starred_url":"https://api.github.com/users/Talend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Talend/subscriptions","organizations_url":"https://api.github.com/users/Talend/orgs","repos_url":"https://api.github.com/users/Talend/repos","events_url":"https://api.github.com/users/Talend/events{/privacy}","received_events_url":"https://api.github.com/users/Talend/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Talend/ui","description":"Talend's unified web UI repository.","fork":false,"url":"https://api.github.com/repos/Talend/ui","forks_url":"https://api.github.com/repos/Talend/ui/forks","keys_url":"https://api.github.com/repos/Talend/ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Talend/ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Talend/ui/teams","hooks_url":"https://api.github.com/repos/Talend/ui/hooks","issue_events_url":"https://api.github.com/repos/Talend/ui/issues/events{/number}","events_url":"https://api.github.com/repos/Talend/ui/events","assignees_url":"https://api.github.com/repos/Talend/ui/assignees{/user}","branches_url":"https://api.github.com/repos/Talend/ui/branches{/branch}","tags_url":"https://api.github.com/repos/Talend/ui/tags","blobs_url":"https://api.github.com/repos/Talend/ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Talend/ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Talend/ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Talend/ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Talend/ui/statuses/{sha}","languages_url":"https://api.github.com/repos/Talend/ui/languages","stargazers_url":"https://api.github.com/repos/Talend/ui/stargazers","contributors_url":"https://api.github.com/repos/Talend/ui/contributors","subscribers_url":"https://api.github.com/repos/Talend/ui/subscribers","subscription_url":"https://api.github.com/repos/Talend/ui/subscription","commits_url":"https://api.github.com/repos/Talend/ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Talend/ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Talend/ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Talend/ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Talend/ui/contents/{+path}","compare_url":"https://api.github.com/repos/Talend/ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Talend/ui/merges","archive_url":"https://api.github.com/repos/Talend/ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Talend/ui/downloads","issues_url":"https://api.github.com/repos/Talend/ui/issues{/number}","pulls_url":"https://api.github.com/repos/Talend/ui/pulls{/number}","milestones_url":"https://api.github.com/repos/Talend/ui/milestones{/number}","notifications_url":"https://api.github.com/repos/Talend/ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Talend/ui/labels{/name}","releases_url":"https://api.github.com/repos/Talend/ui/releases{/id}","deployments_url":"https://api.github.com/repos/Talend/ui/deployments","created_at":"2017-01-18T13:45:58Z","updated_at":"2018-07-24T12:30:44Z","pushed_at":"2018-07-25T13:54:47Z","git_url":"git://github.com/Talend/ui.git","ssh_url":"git@github.com:Talend/ui.git","clone_url":"https://github.com/Talend/ui.git","svn_url":"https://github.com/Talend/ui","homepage":"http://talend.surge.sh","size":30449,"stargazers_count":57,"watchers_count":57,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":52,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":19,"open_issues":52,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Talend/ui/pulls/1538"},"html":{"href":"https://github.com/Talend/ui/pull/1538"},"issue":{"href":"https://api.github.com/repos/Talend/ui/issues/1538"},"comments":{"href":"https://api.github.com/repos/Talend/ui/issues/1538/comments"},"review_comments":{"href":"https://api.github.com/repos/Talend/ui/pulls/1538/comments"},"review_comment":{"href":"https://api.github.com/repos/Talend/ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Talend/ui/pulls/1538/commits"},"statuses":{"href":"https://api.github.com/repos/Talend/ui/statuses/bc633c8c801868ad679d0eef87237aad17b24369"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jdescottes-talend"}}