@builder6/query-mongodb 0.15.3 → 0.15.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/pipelines.js CHANGED
@@ -340,9 +340,9 @@ function _fixAndChainWithIncompleteAnds(chain) {
340
340
  }
341
341
 
342
342
  var tryParseDate = function tryParseDate(value) {
343
- var isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;
343
+ var isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})$/;
344
344
 
345
- if (typeof value === 'string' && value.length >= 20 && value.length <= 24) {
345
+ if (typeof value === 'string' && value.length >= 20 && value.length <= 29) {
346
346
  if (isoDateRegex.test(value)) {
347
347
  var dateValue = Date.parse(value);
348
348
  if (!isNaN(dateValue)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder6/query-mongodb",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "description": "Querying a MongoDB collection using DevExtreme data store load parameters",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "e25c55a56e28f3a3bd6e28b1e54bc7bdbbb298cd"
59
+ "gitHead": "b28edf03179280c46a45bd499adb84a86a5fe0e8"
60
60
  }
package/src/pipelines.js CHANGED
@@ -296,11 +296,12 @@ function* _fixAndChainWithIncompleteAnds(chain) {
296
296
  }
297
297
 
298
298
  const tryParseDate = (value) => {
299
- // 正则表达式,用于匹配 ISO 8601 日期格式
300
- const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;
301
-
299
+ // 正则表达式,用于匹配 ISO 8601 日期格式,YYYY-MM-DDTHH:MM:SS.SSS+00:00 和 YYYY-MM-DDTHH:MM:SS.SSSZ 两种格式
300
+ // YYYY-MM-DDTHH:MM:SS.SSS+00:00 这种格式是amis input-datetime控件输出的字段值格式
301
+ const isoDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})$/;
302
+
302
303
  // 检查字符串是否为有效日期字符串的基本条件
303
- if (typeof value === 'string' && value.length >= 20 && value.length <= 24) {
304
+ if (typeof value === 'string' && value.length >= 20 && value.length <= 29) {
304
305
  // 使用正则表达式测试
305
306
  if (isoDateRegex.test(value)) {
306
307
  // 使用 Date.parse() 进一步验证是否为有效日期