@@ -14,6 +14,9 @@ import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
1414import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js' ;
1515import { registerStyles , ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js' ;
1616
17+ const MIN_ALLOWED_TIME = '00:00:00.000' ;
18+ const MAX_ALLOWED_TIME = '23:59:59.999' ;
19+
1720registerStyles ( 'vaadin-time-picker' , inputFieldShared , { moduleId : 'vaadin-time-picker-styles' } ) ;
1821
1922/**
@@ -166,7 +169,7 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
166169 */
167170 min : {
168171 type : String ,
169- value : '00:00:00.000 ' ,
172+ value : '' ,
170173 } ,
171174
172175 /**
@@ -180,7 +183,7 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
180183 */
181184 max : {
182185 type : String ,
183- value : '23:59:59.999 ' ,
186+ value : '' ,
184187 } ,
185188
186189 /**
@@ -485,10 +488,10 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
485488
486489 /** @private */
487490 __updateDropdownItems ( i8n , min , max , step ) {
488- const minTimeObj = this . __validateTime ( this . __parseISO ( min ) ) ;
491+ const minTimeObj = this . __validateTime ( this . __parseISO ( min || MIN_ALLOWED_TIME ) ) ;
489492 const minSec = this . __getSec ( minTimeObj ) ;
490493
491- const maxTimeObj = this . __validateTime ( this . __parseISO ( max ) ) ;
494+ const maxTimeObj = this . __validateTime ( this . __parseISO ( max || MAX_ALLOWED_TIME ) ) ;
492495 const maxSec = this . __getSec ( maxTimeObj ) ;
493496
494497 this . __adjustValue ( minSec , maxSec , minTimeObj , maxTimeObj ) ;
@@ -665,8 +668,8 @@ class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMix
665668 * @protected
666669 */
667670 _timeAllowed ( time ) {
668- const parsedMin = this . i18n . parseTime ( this . min ) ;
669- const parsedMax = this . i18n . parseTime ( this . max ) ;
671+ const parsedMin = this . i18n . parseTime ( this . min || MIN_ALLOWED_TIME ) ;
672+ const parsedMax = this . i18n . parseTime ( this . max || MAX_ALLOWED_TIME ) ;
670673
671674 return (
672675 ( ! this . __getMsec ( parsedMin ) || this . __getMsec ( time ) >= this . __getMsec ( parsedMin ) ) &&
0 commit comments