react-datetime
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -26,2 +26,3 @@ 'use strict'; | ||
// defaultValue: TYPES.object | TYPES.string, | ||
closeOnSelect: TYPES.bool, | ||
onBlur: TYPES.func, | ||
@@ -221,3 +222,3 @@ onChange: TYPES.func, | ||
updateSelectedDate: function( e ) { | ||
updateSelectedDate: function( e, close ) { | ||
var target = e.target, | ||
@@ -249,2 +250,6 @@ modifier = 0, | ||
inputValue: date.format( this.state.inputFormat ) | ||
}, function () { | ||
if (this.props.closeOnSelect && close) { | ||
this.closeCalendar(); | ||
} | ||
}); | ||
@@ -260,2 +265,6 @@ } | ||
closeCalendar: function() { | ||
this.setState({ open: false }); | ||
}, | ||
handleClickOutside: function(){ | ||
@@ -262,0 +271,0 @@ if( this.props.input && this.state.open && !this.props.open ){ |
{ | ||
"name": "react-datetime", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A lightweight but complete datetime picker React.js component.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/arqex/react-datetime", |
@@ -64,2 +64,3 @@ react-datetime | ||
| **strictParsing** | boolean | false | Whether to use moment's [strict parsing](http://momentjs.com/docs/#/parsing/string-format/) when parsing input. | ||
| **closeOnSelect** | boolean | false | When `true`, once the day has been selected, the react-datetime will be automatically closed. | ||
@@ -66,0 +67,0 @@ ## i18n |
@@ -96,3 +96,3 @@ var React = require('react'), | ||
if( !disabled ) | ||
dayProps.onClick = this.props.updateSelectedDate; | ||
dayProps.onClick = this.updateSelectedDate; | ||
@@ -112,2 +112,6 @@ days.push( renderer( dayProps, currentDate, selected ) ); | ||
updateSelectedDate: function( event ) { | ||
this.props.updateSelectedDate(event, true); | ||
}, | ||
renderDay: function( props, currentDate, selectedDate ){ | ||
@@ -114,0 +118,0 @@ return DOM.td( props, currentDate.date() ); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
971615
5097
141