dts-backoffice-util 15.2.0 → 15.3.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.
- package/README.md +1 -1
- package/esm2020/lib/utils/disclaimer.util.mjs +38 -1
- package/fesm2015/dts-backoffice-util.mjs +37 -0
- package/fesm2015/dts-backoffice-util.mjs.map +1 -1
- package/fesm2020/dts-backoffice-util.mjs +37 -0
- package/fesm2020/dts-backoffice-util.mjs.map +1 -1
- package/lib/utils/disclaimer.util.d.ts +4 -2
- package/package.json +1 -1
|
@@ -635,6 +635,18 @@ class DisclaimerUtil {
|
|
|
635
635
|
value: `${value.valInitial};${value.valFinal}`
|
|
636
636
|
};
|
|
637
637
|
}
|
|
638
|
+
makeDisclaimerFromDatepickerRange(property, value, hideClose = false) {
|
|
639
|
+
if (!value) {
|
|
640
|
+
return { label: '', property: '', value: '' };
|
|
641
|
+
}
|
|
642
|
+
let filterRangeDate = {
|
|
643
|
+
iniInitial: new Date(1900, 1, 1),
|
|
644
|
+
valInitial: this.ajustDate(value.start),
|
|
645
|
+
iniFinal: new Date(9999, 11, 31),
|
|
646
|
+
valFinal: this.ajustDate(value.end)
|
|
647
|
+
};
|
|
648
|
+
return this.makeDisclaimerFromRangeDate(property, filterRangeDate, hideClose, true);
|
|
649
|
+
}
|
|
638
650
|
makeDisclaimerFromRangeDate(property, value, hideClose = false, validateEqual = true) {
|
|
639
651
|
let valInitDate = this.ajustDate(value.valInitial);
|
|
640
652
|
let valFinalDate = this.ajustDate(value.valFinal);
|
|
@@ -808,6 +820,22 @@ class DisclaimerUtil {
|
|
|
808
820
|
}
|
|
809
821
|
return this.atzRangeNumFromQueryParam(value, rangeNum);
|
|
810
822
|
}
|
|
823
|
+
atzDatepickerRangeFromDisclamer(disclaimers, property, rangeDate) {
|
|
824
|
+
let filterRangeDate = {
|
|
825
|
+
iniInitial: null,
|
|
826
|
+
valInitial: rangeDate ? this.ajustDate(rangeDate.start) : null,
|
|
827
|
+
iniFinal: null,
|
|
828
|
+
valFinal: rangeDate ? this.ajustDate(rangeDate.end) : null
|
|
829
|
+
};
|
|
830
|
+
filterRangeDate = this.atzRangeDateFromDisclamer(disclaimers, property, filterRangeDate);
|
|
831
|
+
if (filterRangeDate.valInitial === null || filterRangeDate.valFinal === null) {
|
|
832
|
+
return null;
|
|
833
|
+
}
|
|
834
|
+
return {
|
|
835
|
+
start: filterRangeDate.valInitial,
|
|
836
|
+
end: filterRangeDate.valFinal
|
|
837
|
+
};
|
|
838
|
+
}
|
|
811
839
|
atzRangeDateFromDisclamer(disclaimers, property, rangeDate) {
|
|
812
840
|
let value = '';
|
|
813
841
|
if (disclaimers && disclaimers.length > 0) {
|
|
@@ -864,12 +892,18 @@ class DisclaimerUtil {
|
|
|
864
892
|
return rangeDate;
|
|
865
893
|
}
|
|
866
894
|
dateToQueryParam(date) {
|
|
895
|
+
if (date === null) {
|
|
896
|
+
return null;
|
|
897
|
+
}
|
|
867
898
|
const iDay = date.getDate();
|
|
868
899
|
const iMonth = date.getMonth() + 1;
|
|
869
900
|
const iYear = date.getFullYear();
|
|
870
901
|
return `${iYear}-${this.pad(iMonth)}-${this.pad(iDay)}`;
|
|
871
902
|
}
|
|
872
903
|
queryParamToDate(param) {
|
|
904
|
+
if (param === null) {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
873
907
|
const iDay = +param.split('-')[2];
|
|
874
908
|
const iMonth = +param.split('-')[1];
|
|
875
909
|
const iYear = +param.split('-')[0];
|
|
@@ -879,6 +913,9 @@ class DisclaimerUtil {
|
|
|
879
913
|
return date instanceof Date && !isNaN(date.getTime());
|
|
880
914
|
}
|
|
881
915
|
ajustDate(param) {
|
|
916
|
+
if (param === null) {
|
|
917
|
+
return null;
|
|
918
|
+
}
|
|
882
919
|
if (param instanceof Date) {
|
|
883
920
|
return param;
|
|
884
921
|
}
|