@yuuvis/client-framework 2.0.14 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -427,10 +427,10 @@ class DatetimeRangeComponent extends AbstractMatFormField {
427
427
  if (value.secondValue && typeof value.secondValue === 'string') {
428
428
  value.secondValue = removeZ(value.secondValue);
429
429
  }
430
- const firstEndsWith = value.firstValue.endsWith('T00:00:00.000');
431
- const secondEndsWith = value.secondValue.endsWith('T23:59:59.000');
430
+ const firstEndsWith = value.firstValue.endsWith(Utils.DEFAULT_RANGE_TIME_V1);
431
+ const secondEndsWith = value.secondValue && value.secondValue.endsWith(Utils.DEFAULT_RANGE_TIME_V2);
432
432
  const firstDate = value.firstValue.slice(0, 10);
433
- const secondDate = value.secondValue.slice(0, 10);
433
+ const secondDate = value.secondValue && value.secondValue.slice(0, 10);
434
434
  if (firstEndsWith && secondEndsWith && firstDate === secondDate) {
435
435
  return {
436
436
  operator: Operator.EQUAL,
@@ -505,7 +505,7 @@ class DatetimeRangeComponent extends AbstractMatFormField {
505
505
  const dateValueFrom = this.#toDate(control.get('dateValueFrom')?.value);
506
506
  const singleValueOperators = new Set([Operator.EQUAL, Operator.GREATER_OR_EQUAL, Operator.LESS_OR_EQUAL]);
507
507
  const rangeOperators = new Set([Operator.INTERVAL_INCLUDE_BOTH]);
508
- if (this.situation === Situation.SEARCH)
508
+ if (this.situation === Situation.SEARCH && !rangeOperators.has(operator))
509
509
  return null;
510
510
  if (singleValueOperators.has(operator)) {
511
511
  if (!Utils.isValidDate(dateValue)) {
@@ -540,11 +540,13 @@ class DatetimeRangeComponent extends AbstractMatFormField {
540
540
  }
541
541
  ngOnInit() {
542
542
  this.rangeForm.setValidators(this.#getValidator());
543
- this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe((v) => {
544
- if (this.ngControl?.control) {
545
- // this.errorState = this.situation === Situation.SEARCH || this._isValid;
546
- this.errorState = !!this.rangeForm.errors;
547
- this.ngControl.control.setErrors(this.rangeForm.errors);
543
+ this.rangeForm.statusChanges.pipe(takeUntilDestroyed(this.#dRef)).subscribe({
544
+ next: () => {
545
+ if (this.ngControl?.control) {
546
+ // this.errorState = this.situation === Situation.SEARCH || this._isValid;
547
+ this.errorState = !!this.rangeForm.errors;
548
+ this.ngControl.control.setErrors(this.rangeForm.errors);
549
+ }
548
550
  }
549
551
  });
550
552
  this.rangeForm.updateValueAndValidity();