Browse Source

Timewindow: fix applying invalid grouping interval when list of allowed intervals set

pull/12220/head
Ekaterina Chantsova 2 years ago
parent
commit
b57b905a5a
  1. 3
      ui-ngx/src/app/shared/components/time/timeinterval.component.ts

3
ui-ngx/src/app/shared/components/time/timeinterval.component.ts

@ -191,8 +191,7 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor, OnCh
if (typeof this.modelValue !== 'undefined') { if (typeof this.modelValue !== 'undefined') {
const min = this.timeService.boundMinInterval(this.minValue); const min = this.timeService.boundMinInterval(this.minValue);
const max = this.timeService.boundMaxInterval(this.maxValue); const max = this.timeService.boundMaxInterval(this.maxValue);
if (this.allowedIntervals?.length || if (IntervalMath.numberValue(this.modelValue) >= min && IntervalMath.numberValue(this.modelValue) <= max) {
IntervalMath.numberValue(this.modelValue) >= min && IntervalMath.numberValue(this.modelValue) <= max) {
const advanced = this.allowedIntervals?.length const advanced = this.allowedIntervals?.length
? !this.allowedIntervals.includes(this.modelValue) ? !this.allowedIntervals.includes(this.modelValue)
: !this.timeService.matchesExistingInterval(this.minValue, this.maxValue, this.modelValue, : !this.timeService.matchesExistingInterval(this.minValue, this.maxValue, this.modelValue,

Loading…
Cancel
Save