@qrvey/utils 1.18.7 → 1.18.8
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
CHANGED
|
@@ -88,16 +88,18 @@ function formatComparativePeriodCaption(period, allDatesText, colLabel = "") {
|
|
|
88
88
|
if (!period?.date1) {
|
|
89
89
|
return colLabel ? `${colLabel} - ${allDatesText}` : allDatesText;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
const d1 = period.formattedDate1 ?? period.date1;
|
|
92
|
+
const d2 = period.formattedDate2 ?? period.date2;
|
|
93
|
+
const dateRange = period.date2 ? `${d1} - ${d2}` : d1;
|
|
94
94
|
return colLabel ? `${colLabel} - ${dateRange}` : dateRange;
|
|
95
95
|
}
|
|
96
96
|
function formatDeltaDefaultCaption(referencePeriod, compareTo, allDatesText, colLabel = "") {
|
|
97
97
|
const fmtPeriodFn = (p) => {
|
|
98
98
|
if (!p?.date1)
|
|
99
99
|
return allDatesText;
|
|
100
|
-
|
|
100
|
+
const d1 = p.formattedDate1 ?? p.date1;
|
|
101
|
+
const d2 = p.formattedDate2 ?? p.date2;
|
|
102
|
+
return p.date2 ? `${d1} - ${d2}` : d1;
|
|
101
103
|
};
|
|
102
104
|
const ref = fmtPeriodFn(referencePeriod);
|
|
103
105
|
const cmp = fmtPeriodFn(compareTo);
|
|
@@ -70,16 +70,18 @@ export function formatComparativePeriodCaption(period, allDatesText, colLabel =
|
|
|
70
70
|
if (!period?.date1) {
|
|
71
71
|
return colLabel ? `${colLabel} - ${allDatesText}` : allDatesText;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const d1 = period.formattedDate1 ?? period.date1;
|
|
74
|
+
const d2 = period.formattedDate2 ?? period.date2;
|
|
75
|
+
const dateRange = period.date2 ? `${d1} - ${d2}` : d1;
|
|
76
76
|
return colLabel ? `${colLabel} - ${dateRange}` : dateRange;
|
|
77
77
|
}
|
|
78
78
|
export function formatDeltaDefaultCaption(referencePeriod, compareTo, allDatesText, colLabel = "") {
|
|
79
79
|
const fmtPeriodFn = (p) => {
|
|
80
80
|
if (!p?.date1)
|
|
81
81
|
return allDatesText;
|
|
82
|
-
|
|
82
|
+
const d1 = p.formattedDate1 ?? p.date1;
|
|
83
|
+
const d2 = p.formattedDate2 ?? p.date2;
|
|
84
|
+
return p.date2 ? `${d1} - ${d2}` : d1;
|
|
83
85
|
};
|
|
84
86
|
const ref = fmtPeriodFn(referencePeriod);
|
|
85
87
|
const cmp = fmtPeriodFn(compareTo);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qrvey/utils",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.8",
|
|
4
4
|
"description": "Helper, Utils for all Qrvey Projects",
|
|
5
5
|
"homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -82,7 +82,8 @@
|
|
|
82
82
|
"dist/**/*"
|
|
83
83
|
],
|
|
84
84
|
"overrides": {
|
|
85
|
-
"
|
|
85
|
+
"brace-expansion": "^5.0.8",
|
|
86
|
+
"js-yaml": "4.3.0"
|
|
86
87
|
},
|
|
87
88
|
"sideEffects": false,
|
|
88
89
|
"types": "dist/index.d.ts"
|