@nokecy/qc-ui 1.0.28 → 1.0.29

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.
@@ -34,9 +34,11 @@ var getFilter = function getFilter(objectKey, value, colDef) {
34
34
  }
35
35
  if (value instanceof Array) {
36
36
  // 处理时间数组
37
- if (value.length === 2 && value.every(function (v) {
38
- return (0, _dayjs.default)(v).isValid();
39
- })) {
37
+ if (value.length === 2 && (value.every(function (v) {
38
+ return (0, _dayjs.default)(v, 'YYYY-MM-DD').isValid();
39
+ }) || value.every(function (v) {
40
+ return (0, _dayjs.default)(v, 'YYYY-MM-DD HH:mm:ss').isValid();
41
+ }))) {
40
42
  return "".concat(objectKey, " >= ").concat((0, _dayjs.default)(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat((0, _dayjs.default)(value[1]).add(1, 'days').format("YYYY-MM-DD"));
41
43
  }
42
44
 
@@ -27,9 +27,11 @@ var getFilter = function getFilter(objectKey, value, colDef) {
27
27
  }
28
28
  if (value instanceof Array) {
29
29
  // 处理时间数组
30
- if (value.length === 2 && value.every(function (v) {
31
- return dayjs(v).isValid();
32
- })) {
30
+ if (value.length === 2 && (value.every(function (v) {
31
+ return dayjs(v, 'YYYY-MM-DD').isValid();
32
+ }) || value.every(function (v) {
33
+ return dayjs(v, 'YYYY-MM-DD HH:mm:ss').isValid();
34
+ }))) {
33
35
  return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD"));
34
36
  }
35
37