semanticdb-core 1.0.41 → 1.0.43
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/dist/common/date.js
CHANGED
|
@@ -98,16 +98,7 @@ function getMinGran(date, flag = false) {
|
|
|
98
98
|
}
|
|
99
99
|
return 'day';
|
|
100
100
|
}
|
|
101
|
-
if (date.$options === '
|
|
102
|
-
return 'year';
|
|
103
|
-
}
|
|
104
|
-
if (date.$options === 'QTD') {
|
|
105
|
-
return 'quarter';
|
|
106
|
-
}
|
|
107
|
-
if (date.$options === 'MTD') {
|
|
108
|
-
return 'month';
|
|
109
|
-
}
|
|
110
|
-
if (date.$options === 'DTD') {
|
|
101
|
+
if (typeof date.$options === 'string' && date.$options.endsWith('TD')) {
|
|
111
102
|
return 'day';
|
|
112
103
|
}
|
|
113
104
|
const checkLTEValid = (lte, tw) => {
|
|
@@ -31,12 +31,17 @@ const isDimensionInQuery = (query, dimension, strictMode = true) => {
|
|
|
31
31
|
return dimension in flattenQuery;
|
|
32
32
|
}
|
|
33
33
|
else if (dimension._id in flattenQuery) {
|
|
34
|
+
const value = flattenQuery[dimension._id];
|
|
34
35
|
if ((0, date_1.isStandardDateForm)(flattenQuery[dimension._id])) {
|
|
35
36
|
const minGran = (0, date_1.getMinGran)(flattenQuery[dimension._id]);
|
|
36
37
|
if (!minGran)
|
|
37
38
|
return false;
|
|
38
39
|
return tws.indexOf(minGran) >= tws.indexOf(dimension.level);
|
|
39
40
|
}
|
|
41
|
+
// XTD系列
|
|
42
|
+
if (typeof value === 'string' && value.length === 3 && value.endsWith('TD')) {
|
|
43
|
+
return tws.indexOf('day') >= tws.indexOf(dimension.level);
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
for (const [k, v] of Object.entries(flattenQuery)) {
|