Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.cjs.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-datetime.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-datetime",
"version": "3.1.0-unc-8",
"version": "3.1.0-unc-9",
"description": "A lightweight but complete datetime picker React.js component",
"homepage": "https://github.com/arqex/react-datetime",
"repository": {
Expand Down
6 changes: 4 additions & 2 deletions src/views/TimeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function createConstraints( overrideTimeConstraints ) {
return constraints;
}

export const IntegerInput = ({value, onChange, min, max}) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't need to be exported

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, checked that this only gets used in the current file

const IntegerInput = ({value, onChange, min, max}) => {
const [stateValue, setStateValue] = useState(value);
const invalid = parseInt(stateValue, 10) !== parseInt(value, 10);

Expand All @@ -53,9 +53,11 @@ export const IntegerInput = ({value, onChange, min, max}) => {
}
}, [onChange, max, min, setStateValue]);

const displayValue = String(stateValue).padStart(2, '0');

return (
<input
value={stateValue}
value={displayValue}
onChange={onChangeCallback}
className={`rdtInput ${invalid && 'invalid'}`}
/>
Expand Down