@cqa-lib/cqa-ui 1.0.114 → 1.0.115
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.
|
@@ -2641,6 +2641,11 @@ class DynamicFilterComponent {
|
|
|
2641
2641
|
start: new FormControl(initialRange.start),
|
|
2642
2642
|
end: new FormControl(initialRange.end),
|
|
2643
2643
|
});
|
|
2644
|
+
// initialize ngx model display
|
|
2645
|
+
this.ngxDateRangeByKey[c.key] = {
|
|
2646
|
+
startDate: initialRange.start || null,
|
|
2647
|
+
endDate: initialRange.end || null
|
|
2648
|
+
};
|
|
2644
2649
|
}
|
|
2645
2650
|
else {
|
|
2646
2651
|
const initial = this.resolveInitialSelectValue(c);
|
|
@@ -2949,22 +2954,12 @@ class DynamicFilterComponent {
|
|
|
2949
2954
|
const endCtrl = dateGroup.controls['end'];
|
|
2950
2955
|
const startVal = startCtrl?.value;
|
|
2951
2956
|
const endVal = endCtrl?.value;
|
|
2952
|
-
|
|
2953
|
-
const endParseErr = endCtrl?.errors?.['matDatepickerParse']?.text;
|
|
2954
|
-
if (!startVal && !endVal && !startParseErr && !endParseErr)
|
|
2957
|
+
if (!startVal && !endVal)
|
|
2955
2958
|
return null;
|
|
2956
|
-
if (startParseErr)
|
|
2957
|
-
return `Invalid start date format`;
|
|
2958
|
-
if (endParseErr)
|
|
2959
|
-
return `Invalid end date format`;
|
|
2960
2959
|
if (startVal && !endVal)
|
|
2961
2960
|
return `Please select an end date`;
|
|
2962
2961
|
if (!startVal && endVal)
|
|
2963
2962
|
return `Please select a start date`;
|
|
2964
|
-
if (dateGroup.hasError('matStartDateInvalid'))
|
|
2965
|
-
return `Start date must be before end date`;
|
|
2966
|
-
if (dateGroup.hasError('matEndDateInvalid'))
|
|
2967
|
-
return `End date must be after start date`;
|
|
2968
2963
|
if (dateGroup.invalid) {
|
|
2969
2964
|
const config = this.config?.find(c => c.key === key);
|
|
2970
2965
|
return config ? `${config.label} is invalid` : 'Date range is invalid';
|