File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -503,11 +503,19 @@ export default class DatePicker extends React.Component {
503
503
this . props . showTimeSelectOnly &&
504
504
! isSameDay ( date , this . props . selected )
505
505
) {
506
- date = set ( this . props . selected , {
507
- hours : getHours ( date ) ,
508
- minutes : getMinutes ( date ) ,
509
- seconds : getSeconds ( date ) ,
510
- } ) ;
506
+ if ( date == null ) {
507
+ date = set ( this . props . selected , {
508
+ hours : getHours ( this . props . selected ) ,
509
+ minutes : getMinutes ( this . props . selected ) ,
510
+ seconds : getSeconds ( this . props . selected ) ,
511
+ } ) ;
512
+ } else {
513
+ date = set ( this . props . selected , {
514
+ hours : getHours ( date ) ,
515
+ minutes : getMinutes ( date ) ,
516
+ seconds : getSeconds ( date ) ,
517
+ } ) ;
518
+ }
511
519
}
512
520
if ( date || ! event . target . value ) {
513
521
this . setSelected ( date , event , true ) ;
You can’t perform that action at this time.
0 commit comments