@@ -47,7 +47,7 @@ var Datetime = createClass({
4747
4848 getInitialState : function ( ) {
4949 this . checkTZ ( this . props ) ;
50-
50+
5151 var state = this . getStateFromProps ( this . props ) ;
5252
5353 if ( state . open === undefined )
@@ -74,6 +74,7 @@ var Datetime = createClass({
7474 } ,
7575
7676 getStateFromProps : function ( props ) {
77+
7778 var formats = this . getFormats ( props ) ,
7879 date = props . value || props . defaultValue ,
7980 selectedDate , viewDate , updateOn , inputValue
@@ -216,6 +217,7 @@ var Datetime = createClass({
216217 } ,
217218
218219 onInputChange : function ( e ) {
220+
219221 var value = e . target === null ? e : e . target . value ,
220222 localMoment = this . localMoment ( value , this . state . inputFormat ) ,
221223 update = { inputValue : value }
@@ -229,7 +231,8 @@ var Datetime = createClass({
229231 }
230232
231233 return this . setState ( update , function ( ) {
232- return this . props . onChange ( localMoment . isValid ( ) ? localMoment : this . state . inputValue ) ;
234+ return this . props . onChange ( localMoment . isValid ( ) ? localMoment : this . state . inputValue
235+ ) ;
233236 } ) ;
234237 } ,
235238
@@ -310,6 +313,7 @@ var Datetime = createClass({
310313 inputValue : date . format ( state . inputFormat )
311314 } ) ;
312315 }
316+
313317 this . props . onChange ( date ) ;
314318 } ,
315319
@@ -321,6 +325,8 @@ var Datetime = createClass({
321325 date
322326 ;
323327
328+ const ctrlPressed = ! ! e . ctrlKey ;
329+
324330 if ( target . className . indexOf ( 'rdtDay' ) !== - 1 ) {
325331 if ( target . className . indexOf ( 'rdtNew' ) !== - 1 )
326332 modifier = 1 ;
@@ -364,7 +370,7 @@ var Datetime = createClass({
364370 }
365371 }
366372
367- this . props . onChange ( date ) ;
373+ this . props . onChange ( date , ctrlPressed ) ;
368374 } ,
369375
370376 openCalendar : function ( e ) {
@@ -416,7 +422,7 @@ var Datetime = createClass({
416422 } ,
417423
418424 componentProps : {
419- fromProps : [ 'value' , 'isValidDate' , 'renderDay' , 'renderMonth' , 'renderYear' , 'timeConstraints' ] ,
425+ fromProps : [ 'value' , 'multiValue' , ' isValidDate', 'renderDay' , 'renderMonth' , 'renderYear' , 'timeConstraints' ] ,
420426 fromState : [ 'viewDate' , 'selectedDate' , 'updateOn' ] ,
421427 fromThis : [ 'setDate' , 'setTime' , 'showView' , 'addTime' , 'subtractTime' , 'updateSelectedDate' , 'localMoment' , 'handleClickOutside' ]
422428 } ,
0 commit comments