mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 874: #2223 WE Filter estimatedShippingDate queryParams Fix
#2223 WE Filter estimatedShippingDate queryParams Fix
This commit is contained in:
committed by
Lorenz Hilpert
parent
7b71c0e343
commit
1e2b527a80
@@ -23,6 +23,7 @@
|
||||
[ngModel]="uiStartOption?.value"
|
||||
(save)="uiStartOption?.setValue($event)"
|
||||
>
|
||||
<ng-container #content>Übernehmen</ng-container>
|
||||
</ui-datepicker>
|
||||
</div>
|
||||
<div *ngIf="uiStopOption" class="option">
|
||||
@@ -49,6 +50,7 @@
|
||||
[ngModel]="uiStopOption?.value"
|
||||
(save)="uiStopOption?.setValue($event)"
|
||||
>
|
||||
<ng-container #content>Übernehmen</ng-container>
|
||||
</ui-datepicker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -167,6 +167,7 @@ export class UiOption implements IUiOption {
|
||||
|
||||
trySetFromValue(value: string) {
|
||||
const type = this.getParentInput()?.type;
|
||||
|
||||
switch (type) {
|
||||
case UiInputType.Bool:
|
||||
case UiInputType.InputSelector:
|
||||
@@ -179,6 +180,9 @@ export class UiOption implements IUiOption {
|
||||
case UiInputType.IntegerRange:
|
||||
this.trySetFromNumberRange(value);
|
||||
break;
|
||||
case UiInputType.DateRange:
|
||||
this.trySetFromDateRange(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,6 +195,32 @@ export class UiOption implements IUiOption {
|
||||
}
|
||||
}
|
||||
|
||||
trySetFromDateRange(value: string) {
|
||||
let split: string[] = [];
|
||||
|
||||
if (value) {
|
||||
if (value?.includes('"-"')) {
|
||||
split = value.split('"-"');
|
||||
} else if (value?.includes('-"')) {
|
||||
split = value.split('-"');
|
||||
} else if (value?.includes('"-')) {
|
||||
split = value.split('"-');
|
||||
}
|
||||
}
|
||||
|
||||
if (this.key === 'start') {
|
||||
if (split[0]) {
|
||||
split[0] = split[0].replace(new RegExp('"', 'g'), '');
|
||||
}
|
||||
this.setValue(split[0]);
|
||||
} else if (this.key === 'stop') {
|
||||
if (split[1]) {
|
||||
split[1] = split[1].replace(new RegExp('"', 'g'), '');
|
||||
}
|
||||
this.setValue(split[1]);
|
||||
}
|
||||
}
|
||||
|
||||
trySetBoolFromValue(value: string) {
|
||||
const valueSplits = value?.split(';');
|
||||
if (valueSplits.includes(this.value)) {
|
||||
|
||||
Reference in New Issue
Block a user