semanticdb-core 1.0.40 → 1.0.42
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.d.ts
CHANGED
|
@@ -16,4 +16,4 @@ export declare function isDateForm(dateValue: any): boolean;
|
|
|
16
16
|
* @param {Boolean} flag 本函数是否在yoymomsplysplm.ts获得最小粒度时被调用
|
|
17
17
|
* @return {String}
|
|
18
18
|
*/
|
|
19
|
-
export declare function getMinGran(date: any, flag?: boolean):
|
|
19
|
+
export declare function getMinGran(date: any, flag?: boolean): unitOfTime.Base | unitOfTime._quarter | unitOfTime._isoWeek | unitOfTime._date | null;
|
package/dist/common/date.js
CHANGED
|
@@ -127,6 +127,9 @@ function getMinGran(date, flag = false) {
|
|
|
127
127
|
for (const tw of [...exports.grans].reverse()) {
|
|
128
128
|
if (gte.isSame((0, moment_1.default)(gte).startOf(tw), 'second') &&
|
|
129
129
|
lte.isSame((0, moment_1.default)(lte).endOf(tw), 'second')) {
|
|
130
|
+
if (tw === 'isoWeek') {
|
|
131
|
+
return 'week';
|
|
132
|
+
}
|
|
130
133
|
return tw;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -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)) {
|