{"action":"created","comment":{"url":"https://api.github.com/repos/buildo/react-components/pulls/comments/54440343","id":54440343,"diff_hunk":"@@ -0,0 +1,211 @@\n+import React from 'react';\n+import { props, t, skinnable } from '../utils';\n+import cx from 'classnames';\n+import Dropdown from '../dropdown/Dropdown';\n+import range from 'lodash/utility/range';\n+import flatten from 'lodash/array/flatten';\n+\n+/*\n+  Options is defined here cause we need to not change the ref.\n+  This happend because of a very wired behaviour of react-select v0.6.12\n+*/\n+const options = [];\n+\n+const H24 = '24h';\n+const H12 = '12h';\n+const symbolRegex = /[\\s,\\.\\|\\/\\\\]/;\n+const numberRegex = /^\\d+$/;\n+const time12Regex = /^([1-9]|1[0-2])[:,\\.\\|\\/\\\\]?([0-5]\\d)?\\s*?(AM|PM)$/;\n+const time24Regex = /^([01]?\\d|2[0-3])[:,\\.\\|\\/\\\\]?([0-5]?\\d)?$/;\n+const separator = ':';\n+\n+const pad = (num) => num <= 9 ? `0${num}` : num;\n+const timeFormatter24 = (hour, minute) => `${pad(hour)}:${pad(minute)}`;\n+const timeFormatter12 = (hour, minute) => {","path":"src/time-picker/TimePicker.js","position":24,"original_position":24,"commit_id":"81b0b7285a4bfa90615184abe3210f7a8f1ce670","original_commit_id":"81b0b7285a4bfa90615184abe3210f7a8f1ce670","user":{"login":"giogonzo","id":2643520,"avatar_url":"https://avatars.githubusercontent.com/u/2643520?v=3","gravatar_id":"","url":"https://api.github.com/users/giogonzo","html_url":"https://github.com/giogonzo","followers_url":"https://api.github.com/users/giogonzo/followers","following_url":"https://api.github.com/users/giogonzo/following{/other_user}","gists_url":"https://api.github.com/users/giogonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/giogonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giogonzo/subscriptions","organizations_url":"https://api.github.com/users/giogonzo/orgs","repos_url":"https://api.github.com/users/giogonzo/repos","events_url":"https://api.github.com/users/giogonzo/events{/privacy}","received_events_url":"https://api.github.com/users/giogonzo/received_events","type":"User","site_admin":false},"body":"the first `if` condition simplifies to `hour === 0 || hour === 24`\r\n\r\nthe last `else` is useless (you're `% 12` anyway before)\r\n\r\n```js\r\nif (hour === 0 || hour === 24) { // WTF: why can we have both 0 and 24 in our internal representation? we should just choose one?\r\n// ...\r\n} else if (hour === 12) {\r\n// ...\r\n} else {\r\n// ...\r\n}\r\n```\r\n\r\nwhich makes me think: why can we have both `0` and `24` in our internal representation? we should just choose one?","created_at":"2016-02-29T16:59:37Z","updated_at":"2016-02-29T16:59:37Z","html_url":"https://github.com/buildo/react-components/pull/310#discussion_r54440343","pull_request_url":"https://api.github.com/repos/buildo/react-components/pulls/310","_links":{"self":{"href":"https://api.github.com/repos/buildo/react-components/pulls/comments/54440343"},"html":{"href":"https://github.com/buildo/react-components/pull/310#discussion_r54440343"},"pull_request":{"href":"https://api.github.com/repos/buildo/react-components/pulls/310"}}},"pull_request":{"url":"https://api.github.com/repos/buildo/react-components/pulls/310","id":59844463,"html_url":"https://github.com/buildo/react-components/pull/310","diff_url":"https://github.com/buildo/react-components/pull/310.diff","patch_url":"https://github.com/buildo/react-components/pull/310.patch","issue_url":"https://api.github.com/repos/buildo/react-components/issues/310","number":310,"state":"open","locked":false,"title":"[WIP] #277: TimePicker (closes #277)","user":{"login":"nerder","id":3502356,"avatar_url":"https://avatars.githubusercontent.com/u/3502356?v=3","gravatar_id":"","url":"https://api.github.com/users/nerder","html_url":"https://github.com/nerder","followers_url":"https://api.github.com/users/nerder/followers","following_url":"https://api.github.com/users/nerder/following{/other_user}","gists_url":"https://api.github.com/users/nerder/gists{/gist_id}","starred_url":"https://api.github.com/users/nerder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nerder/subscriptions","organizations_url":"https://api.github.com/users/nerder/orgs","repos_url":"https://api.github.com/users/nerder/repos","events_url":"https://api.github.com/users/nerder/events{/privacy}","received_events_url":"https://api.github.com/users/nerder/received_events","type":"User","site_admin":false},"body":"Issue #277","created_at":"2016-02-18T18:46:47Z","updated_at":"2016-02-29T16:59:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16ded651164da9dd151f740240141b8e588865ca","assignee":{"login":"giogonzo","id":2643520,"avatar_url":"https://avatars.githubusercontent.com/u/2643520?v=3","gravatar_id":"","url":"https://api.github.com/users/giogonzo","html_url":"https://github.com/giogonzo","followers_url":"https://api.github.com/users/giogonzo/followers","following_url":"https://api.github.com/users/giogonzo/following{/other_user}","gists_url":"https://api.github.com/users/giogonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/giogonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giogonzo/subscriptions","organizations_url":"https://api.github.com/users/giogonzo/orgs","repos_url":"https://api.github.com/users/giogonzo/repos","events_url":"https://api.github.com/users/giogonzo/events{/privacy}","received_events_url":"https://api.github.com/users/giogonzo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/buildo/react-components/pulls/310/commits","review_comments_url":"https://api.github.com/repos/buildo/react-components/pulls/310/comments","review_comment_url":"https://api.github.com/repos/buildo/react-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/buildo/react-components/issues/310/comments","statuses_url":"https://api.github.com/repos/buildo/react-components/statuses/81b0b7285a4bfa90615184abe3210f7a8f1ce670","head":{"label":"buildo:react_components-277-hourpicker","ref":"react_components-277-hourpicker","sha":"81b0b7285a4bfa90615184abe3210f7a8f1ce670","user":{"login":"buildo","id":7370958,"avatar_url":"https://avatars.githubusercontent.com/u/7370958?v=3","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"repo":{"id":38420518,"name":"react-components","full_name":"buildo/react-components","owner":{"login":"buildo","id":7370958,"avatar_url":"https://avatars.githubusercontent.com/u/7370958?v=3","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildo/react-components","description":"Collection of general React components used in buildo projects.","fork":false,"url":"https://api.github.com/repos/buildo/react-components","forks_url":"https://api.github.com/repos/buildo/react-components/forks","keys_url":"https://api.github.com/repos/buildo/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildo/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildo/react-components/teams","hooks_url":"https://api.github.com/repos/buildo/react-components/hooks","issue_events_url":"https://api.github.com/repos/buildo/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/buildo/react-components/events","assignees_url":"https://api.github.com/repos/buildo/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/buildo/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/buildo/react-components/tags","blobs_url":"https://api.github.com/repos/buildo/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildo/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildo/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildo/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildo/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/buildo/react-components/languages","stargazers_url":"https://api.github.com/repos/buildo/react-components/stargazers","contributors_url":"https://api.github.com/repos/buildo/react-components/contributors","subscribers_url":"https://api.github.com/repos/buildo/react-components/subscribers","subscription_url":"https://api.github.com/repos/buildo/react-components/subscription","commits_url":"https://api.github.com/repos/buildo/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildo/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildo/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildo/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildo/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/buildo/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildo/react-components/merges","archive_url":"https://api.github.com/repos/buildo/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildo/react-components/downloads","issues_url":"https://api.github.com/repos/buildo/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/buildo/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/buildo/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/buildo/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildo/react-components/labels{/name}","releases_url":"https://api.github.com/repos/buildo/react-components/releases{/id}","deployments_url":"https://api.github.com/repos/buildo/react-components/deployments","created_at":"2015-07-02T08:26:45Z","updated_at":"2016-02-25T13:48:14Z","pushed_at":"2016-02-29T14:26:19Z","git_url":"git://github.com/buildo/react-components.git","ssh_url":"git@github.com:buildo/react-components.git","clone_url":"https://github.com/buildo/react-components.git","svn_url":"https://github.com/buildo/react-components","homepage":"http://buildo.github.io/react-components","size":18704,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":8,"default_branch":"master"}},"base":{"label":"buildo:master","ref":"master","sha":"a6b13cdf1b02c8956afafbf562cc61a2d795fa89","user":{"login":"buildo","id":7370958,"avatar_url":"https://avatars.githubusercontent.com/u/7370958?v=3","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"repo":{"id":38420518,"name":"react-components","full_name":"buildo/react-components","owner":{"login":"buildo","id":7370958,"avatar_url":"https://avatars.githubusercontent.com/u/7370958?v=3","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildo/react-components","description":"Collection of general React components used in buildo projects.","fork":false,"url":"https://api.github.com/repos/buildo/react-components","forks_url":"https://api.github.com/repos/buildo/react-components/forks","keys_url":"https://api.github.com/repos/buildo/react-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildo/react-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildo/react-components/teams","hooks_url":"https://api.github.com/repos/buildo/react-components/hooks","issue_events_url":"https://api.github.com/repos/buildo/react-components/issues/events{/number}","events_url":"https://api.github.com/repos/buildo/react-components/events","assignees_url":"https://api.github.com/repos/buildo/react-components/assignees{/user}","branches_url":"https://api.github.com/repos/buildo/react-components/branches{/branch}","tags_url":"https://api.github.com/repos/buildo/react-components/tags","blobs_url":"https://api.github.com/repos/buildo/react-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildo/react-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildo/react-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildo/react-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildo/react-components/statuses/{sha}","languages_url":"https://api.github.com/repos/buildo/react-components/languages","stargazers_url":"https://api.github.com/repos/buildo/react-components/stargazers","contributors_url":"https://api.github.com/repos/buildo/react-components/contributors","subscribers_url":"https://api.github.com/repos/buildo/react-components/subscribers","subscription_url":"https://api.github.com/repos/buildo/react-components/subscription","commits_url":"https://api.github.com/repos/buildo/react-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildo/react-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildo/react-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildo/react-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildo/react-components/contents/{+path}","compare_url":"https://api.github.com/repos/buildo/react-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildo/react-components/merges","archive_url":"https://api.github.com/repos/buildo/react-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildo/react-components/downloads","issues_url":"https://api.github.com/repos/buildo/react-components/issues{/number}","pulls_url":"https://api.github.com/repos/buildo/react-components/pulls{/number}","milestones_url":"https://api.github.com/repos/buildo/react-components/milestones{/number}","notifications_url":"https://api.github.com/repos/buildo/react-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildo/react-components/labels{/name}","releases_url":"https://api.github.com/repos/buildo/react-components/releases{/id}","deployments_url":"https://api.github.com/repos/buildo/react-components/deployments","created_at":"2015-07-02T08:26:45Z","updated_at":"2016-02-25T13:48:14Z","pushed_at":"2016-02-29T14:26:19Z","git_url":"git://github.com/buildo/react-components.git","ssh_url":"git@github.com:buildo/react-components.git","clone_url":"https://github.com/buildo/react-components.git","svn_url":"https://github.com/buildo/react-components","homepage":"http://buildo.github.io/react-components","size":18704,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/buildo/react-components/pulls/310"},"html":{"href":"https://github.com/buildo/react-components/pull/310"},"issue":{"href":"https://api.github.com/repos/buildo/react-components/issues/310"},"comments":{"href":"https://api.github.com/repos/buildo/react-components/issues/310/comments"},"review_comments":{"href":"https://api.github.com/repos/buildo/react-components/pulls/310/comments"},"review_comment":{"href":"https://api.github.com/repos/buildo/react-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/buildo/react-components/pulls/310/commits"},"statuses":{"href":"https://api.github.com/repos/buildo/react-components/statuses/81b0b7285a4bfa90615184abe3210f7a8f1ce670"}}}}