semanticdb-core 1.0.32 → 1.0.33
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 +5 -2
- package/dist/schema/schema.d.ts +1 -1
- package/package.json +1 -1
package/dist/common/date.js
CHANGED
|
@@ -122,11 +122,14 @@ function getMinGran(date, flag = false) {
|
|
|
122
122
|
if (date.$options === 'DTD') {
|
|
123
123
|
return 'day';
|
|
124
124
|
}
|
|
125
|
+
const checkLTEValid = (lte, tw) => {
|
|
126
|
+
return (0, moment_1.default)(lte).isSame((0, moment_1.default)(lte).endOf(tw));
|
|
127
|
+
};
|
|
125
128
|
for (const tw of exports.grans) {
|
|
126
|
-
if (tw && tw in date.$options) {
|
|
129
|
+
if (tw && tw in date.$options && checkLTEValid(date.$lte, tw)) {
|
|
127
130
|
return tw;
|
|
128
131
|
}
|
|
129
|
-
if (tw === 'isoWeek' && 'week' in date.$options) {
|
|
132
|
+
if (tw === 'isoWeek' && 'week' in date.$options && checkLTEValid(date.$lte, tw)) {
|
|
130
133
|
return tw;
|
|
131
134
|
}
|
|
132
135
|
}
|
package/dist/schema/schema.d.ts
CHANGED