react-datetime-picker
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -385,2 +385,3 @@ 'use strict'; | ||
minDate: this.props.minDate, | ||
name: this.props.name, | ||
onChange: this.onChangeNative, | ||
@@ -511,3 +512,4 @@ required: this.props.required, | ||
DateTimeInput.defaultProps = { | ||
maxDetail: 'minute' | ||
maxDetail: 'minute', | ||
name: 'datetime' | ||
}; | ||
@@ -521,2 +523,3 @@ | ||
minDate: _propTypes3.isMinDate, | ||
name: _propTypes2.default.string, | ||
onChange: _propTypes2.default.func, | ||
@@ -523,0 +526,0 @@ required: _propTypes2.default.bool, |
@@ -56,2 +56,3 @@ 'use strict'; | ||
minDate = _props.minDate, | ||
name = _props.name, | ||
onChange = _props.onChange, | ||
@@ -66,3 +67,3 @@ required = _props.required, | ||
min: minDate ? nativeValueParser(minDate) : null, | ||
name: 'datetime', | ||
name: name, | ||
onChange: onChange, | ||
@@ -91,2 +92,3 @@ onFocus: this.stopPropagation, | ||
minDate: _propTypes3.isMinDate, | ||
name: _propTypes2.default.string, | ||
onChange: _propTypes2.default.func, | ||
@@ -93,0 +95,0 @@ required: _propTypes2.default.bool, |
@@ -80,3 +80,6 @@ 'use strict'; | ||
}, _this.closeWidgets = function () { | ||
_this.setState({ isClockOpen: false }); | ||
_this.setState({ | ||
isCalendarOpen: false, | ||
isClockOpen: false | ||
}); | ||
}, _this.toggleClock = function () { | ||
@@ -117,7 +120,10 @@ _this.setState(function (prevState) { | ||
case 'year': | ||
return _this.openCalendar(); | ||
_this.openCalendar(); | ||
break; | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
return _this.openClock(); | ||
_this.openClock(); | ||
break; | ||
default: | ||
} | ||
@@ -165,2 +171,3 @@ }, _this.stopPropagation = function (event) { | ||
minDate = _props.minDate, | ||
name = _props.name, | ||
required = _props.required, | ||
@@ -180,2 +187,3 @@ value = _props.value; | ||
minDate: minDate, | ||
name: name, | ||
onChange: this.onChange, | ||
@@ -370,2 +378,3 @@ placeholder: this.placeholder, | ||
minDate: _propTypes3.isMinDate, | ||
name: _propTypes2.default.string, | ||
onChange: _propTypes2.default.func, | ||
@@ -372,0 +381,0 @@ required: _propTypes2.default.bool, |
{ | ||
"name": "react-datetime-picker", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An input component for picking date and time for your React application.", | ||
@@ -13,6 +13,10 @@ "main": "dist/entry.js", | ||
"prepublishOnly": "npm run build", | ||
"preversion": "npm run version-sample && npm run version-test", | ||
"test": "npm run test-eslint && npm run test-jest", | ||
"test-eslint": "eslint ./src", | ||
"test-jest": "jest", | ||
"test-jest-coverage": "jest --coverage" | ||
"test-jest-coverage": "jest --coverage", | ||
"version": "npm run build && git add .", | ||
"version-sample": "cd sample && npm version patch", | ||
"version-test": "cd test && npm version patch" | ||
}, | ||
@@ -25,3 +29,4 @@ "jest": { | ||
"**/src/**.{js,jsx}", | ||
"!**/src/entry.js" | ||
"!**/src/entry.js", | ||
"!**/src/entry.nostyle.js" | ||
] | ||
@@ -53,3 +58,3 @@ }, | ||
"react-dom": ">=15.5", | ||
"react-time-picker": "^2.1.1" | ||
"react-time-picker": "^2.1.2" | ||
}, | ||
@@ -56,0 +61,0 @@ "devDependencies": { |
@@ -433,2 +433,3 @@ import React, { Component } from 'react'; | ||
minDate={this.props.minDate} | ||
name={this.props.name} | ||
onChange={this.onChangeNative} | ||
@@ -456,2 +457,3 @@ required={this.props.required} | ||
maxDetail: 'minute', | ||
name: 'datetime', | ||
}; | ||
@@ -465,2 +467,3 @@ | ||
minDate: isMinDate, | ||
name: PropTypes.string, | ||
onChange: PropTypes.func, | ||
@@ -467,0 +470,0 @@ required: PropTypes.bool, |
@@ -16,3 +16,3 @@ import React, { PureComponent } from 'react'; | ||
const { | ||
maxDate, minDate, onChange, required, value, | ||
maxDate, minDate, name, onChange, required, value, | ||
} = this.props; | ||
@@ -25,3 +25,3 @@ | ||
min={minDate ? nativeValueParser(minDate) : null} | ||
name="datetime" | ||
name={name} | ||
onChange={onChange} | ||
@@ -45,2 +45,3 @@ onFocus={this.stopPropagation} | ||
minDate: isMinDate, | ||
name: PropTypes.string, | ||
onChange: PropTypes.func, | ||
@@ -47,0 +48,0 @@ required: PropTypes.bool, |
@@ -55,3 +55,6 @@ import React, { Component } from 'react'; | ||
closeWidgets = () => { | ||
this.setState({ isClockOpen: false }); | ||
this.setState({ | ||
isCalendarOpen: false, | ||
isClockOpen: false, | ||
}); | ||
} | ||
@@ -91,11 +94,14 @@ | ||
onFocus = (event) => { | ||
switch(event.target.name) { | ||
switch (event.target.name) { | ||
case 'day': | ||
case 'month': | ||
case 'year': | ||
return this.openCalendar(); | ||
this.openCalendar(); | ||
break; | ||
case 'hour': | ||
case 'minute': | ||
case 'second': | ||
return this.openClock(); | ||
this.openClock(); | ||
break; | ||
default: | ||
} | ||
@@ -116,2 +122,3 @@ } | ||
minDate, | ||
name, | ||
required, | ||
@@ -131,2 +138,3 @@ value, | ||
minDate={minDate} | ||
name={name} | ||
onChange={this.onChange} | ||
@@ -322,2 +330,3 @@ placeholder={this.placeholder} | ||
minDate: isMinDate, | ||
name: PropTypes.string, | ||
onChange: PropTypes.func, | ||
@@ -324,0 +333,0 @@ required: PropTypes.bool, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
96782
2296
0
Updatedreact-time-picker@^2.1.2