@@ -401,7 +401,7 @@ class DatePicker extends UI5Element {
401
401
this . maxDate = null ;
402
402
console . warn ( `In order for the "maxDate" property to have effect, you should enter valid date format` ) ; // eslint-disable-line
403
403
}
404
- if ( this . isValid ( this . value ) && this . isInValidRange ( this . _getTimeStampFromString ( this . value ) ) ) {
404
+ if ( this . _checkValueValidity ( this . value ) ) {
405
405
this . _changeCalendarSelection ( ) ;
406
406
} else {
407
407
this . _calendar . selectedDates = [ ] ;
@@ -462,10 +462,9 @@ class DatePicker extends UI5Element {
462
462
_handleInputChange ( ) {
463
463
let nextValue = this . _getInput ( ) . getInputValue ( ) ;
464
464
const emptyValue = nextValue === "" ;
465
- const isValid = emptyValue || this . isValid ( nextValue ) ;
466
- const isInValidRange = this . isInValidRange ( this . _getTimeStampFromString ( nextValue ) ) ;
465
+ const isValid = emptyValue || this . _checkValueValidity ( nextValue ) ;
467
466
468
- if ( isValid && isInValidRange ) {
467
+ if ( isValid ) {
469
468
nextValue = this . normalizeValue ( nextValue ) ;
470
469
this . valueState = ValueState . None ;
471
470
} else {
@@ -482,12 +481,16 @@ class DatePicker extends UI5Element {
482
481
_handleInputLiveChange ( ) {
483
482
const nextValue = this . _getInput ( ) . getInputValue ( ) ;
484
483
const emptyValue = nextValue === "" ;
485
- const isValid = emptyValue || ( this . isValid ( nextValue ) && this . isInValidRange ( this . _getTimeStampFromString ( nextValue ) ) ) ;
484
+ const isValid = emptyValue || this . _checkValueValidity ( nextValue ) ;
486
485
487
486
this . value = nextValue ;
488
487
this . fireEvent ( "input" , { value : nextValue , valid : isValid } ) ;
489
488
}
490
489
490
+ _checkValueValidity ( value ) {
491
+ return this . isValid ( value ) && this . isInValidRange ( this . _getTimeStampFromString ( value ) ) ;
492
+ }
493
+
491
494
_click ( event ) {
492
495
if ( isPhone ( ) ) {
493
496
this . responsivePopover . open ( this ) ;
0 commit comments