@@ -318,11 +318,11 @@ class DurationPicker extends UI5Element {
318
318
currentSeconds = this . getSecondsFromFormattedValue ( destructuredValues ) ; // this.hideHours && this.hideHours ? destructuredValues[0] : {};
319
319
320
320
if ( currentHours > - 1 ) {
321
- if ( currentHours > this . _maxValue [ 0 ] ) {
321
+ if ( parseInt ( currentHours ) > parseInt ( this . _maxValue [ 0 ] ) ) {
322
322
currentHours = this . _maxValue [ 0 ] ;
323
323
}
324
324
325
- this . selectedHours = this . _formatSelectedValue ( currentHours , 23 ) ;
325
+ this . selectedHours = this . _formatSelectedValue ( currentHours , parseInt ( this . readFormattedValue ( this . maxValue ) ) ) ;
326
326
}
327
327
328
328
if ( currentMinutes > - 1 ) {
@@ -331,7 +331,7 @@ class DurationPicker extends UI5Element {
331
331
}
332
332
if ( this . _maxValue [ 0 ] && this . selectedHours === this . _maxValue [ 0 ] ) {
333
333
currentMinutes = currentMinutes > this . _maxValue [ 1 ] ? this . _maxValue [ 1 ] : currentMinutes ;
334
- } else if ( currentMinutes > this . _maxValue [ 1 ] ) {
334
+ } else if ( parseInt ( currentMinutes ) > parseInt ( this . _maxValue [ 1 ] ) ) {
335
335
currentMinutes = this . _maxValue [ 1 ] ;
336
336
}
337
337
@@ -344,15 +344,15 @@ class DurationPicker extends UI5Element {
344
344
}
345
345
if ( this . _maxValue [ 0 ] && this . _maxValue [ 1 ] && this . selectedHours >= this . _maxValue [ 0 ] && this . selectedSeconds >= this . _maxValue [ 1 ] ) {
346
346
currentSeconds = currentSeconds > this . _maxValue [ 2 ] ? this . _maxValue [ 2 ] : currentSeconds ;
347
- } else if ( currentSeconds > this . _maxValue [ 2 ] ) {
347
+ } else if ( parseInt ( currentSeconds ) > parseInt ( this . _maxValue [ 2 ] ) ) {
348
348
currentSeconds = this . _maxValue [ 2 ] ;
349
349
}
350
350
351
351
this . selectedSeconds = this . _formatSelectedValue ( currentSeconds , 59 ) ;
352
352
}
353
353
}
354
354
355
- _formatSelectedValue ( currentValue , maximum ) {
355
+ _formatSelectedValue ( currentValue , maximum = Infinity ) {
356
356
if ( currentValue . length === 1 ) {
357
357
return `0${ currentValue } ` ;
358
358
}
@@ -494,8 +494,18 @@ class DurationPicker extends UI5Element {
494
494
}
495
495
496
496
get hoursArray ( ) {
497
- const currentHours = parseInt ( this . readFormattedValue ( this . maxValue ) [ 0 ] ) ;
498
- const hours = currentHours && currentHours > 0 && currentHours < 23 ? currentHours + 1 : 24 ;
497
+ const _maxHours = parseInt ( this . readFormattedValue ( this . maxValue ) [ 0 ] ) ;
498
+ const _currHours = parseInt ( this . selectedHours ) + 1 ;
499
+ let hours ;
500
+
501
+ if ( _maxHours ) {
502
+ hours = _maxHours + 1 ;
503
+ } else if ( _currHours < 24 ) {
504
+ hours = 24 ;
505
+ } else {
506
+ hours = _currHours ;
507
+ }
508
+
499
509
return this . generateTimeItemsArray ( hours ) ;
500
510
}
501
511
0 commit comments