schummar-table 1.0.4 → 1.0.5
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/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2274,9 +2274,18 @@ function DateFilterComponent({ value = null, onChange, close, options: { locale,
|
|
|
2274
2274
|
})
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
|
+
/** Like dateIntersect, but compares the exact times instead of whole days. */
|
|
2278
|
+
function timeIntersect(range, x) {
|
|
2279
|
+
if (!x) return false;
|
|
2280
|
+
const { min, max } = x instanceof Date ? {
|
|
2281
|
+
min: x,
|
|
2282
|
+
max: x
|
|
2283
|
+
} : x;
|
|
2284
|
+
return !(range.max < min || range.min > max);
|
|
2285
|
+
}
|
|
2277
2286
|
const dateFilter = defineFilter({
|
|
2278
2287
|
isActive: (value) => !!value,
|
|
2279
|
-
test: (value, input) => require_useTheme.toSingles(input).some((x) => require_useTheme.dateIntersect(value, toDate(x))),
|
|
2288
|
+
test: (value, input, { showTime }) => require_useTheme.toSingles(input).some((x) => showTime && value && !(value instanceof Date) ? timeIntersect(value, toDate(x)) : require_useTheme.dateIntersect(value, toDate(x))),
|
|
2280
2289
|
Component: DateFilterComponent
|
|
2281
2290
|
});
|
|
2282
2291
|
//#endregion
|