From fe62b0265c0ff4cb2565bfdbe372b0365e02f3cf Mon Sep 17 00:00:00 2001 From: Douding Date: Tue, 26 Sep 2023 10:11:55 +0800 Subject: [PATCH] fix: COMMON_TIME_FORMAT (#170) --- packages/graphic-walker/src/lib/inferMeta.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/graphic-walker/src/lib/inferMeta.ts b/packages/graphic-walker/src/lib/inferMeta.ts index 2da45236..6e867003 100644 --- a/packages/graphic-walker/src/lib/inferMeta.ts +++ b/packages/graphic-walker/src/lib/inferMeta.ts @@ -2,13 +2,13 @@ import { IAnalyticType, IMutField, IRow, ISemanticType, IUncertainMutField } fro import { getValueByKeyPath } from '../utils/dataPrep'; const COMMON_TIME_FORMAT: RegExp[] = [ - /^\d{4}-(0[1-9]|1[1,2])-(0[1-9]|[12][0-9]|3[01])$/, // YYYY-MM-DD - /^(0[1-9]|1[1,2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/, // MM/DD/YYYY - /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[1,2])\/\d{4}$/, // DD/MM/YYYY - /^\d{4}\/(0[1-9]|1[1,2])\/(0[1-9]|[12][0-9]|3[01])$/, // YYYY/MM/DD - /^\d{4}\.(0[1-9]|1[1,2])\.(0[1-9]|[12][0-9]|3[01])$/, // YYYY.MM.DD - /^\d{4}-(0[1-9]|1[1,2])-(0[1-9]|[12][0-9]|3[01])\s\d{2}:\d{2}:\d{2}$/, // YYYY-MM-DD HH:MM:SS - /^\d{4}-(0[1-9]|1[1,2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}$/, // YYYY-MM-DDTHH:MM:SS (ISO-8601) + /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/, // YYYY-MM-DD + /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/, // MM/DD/YYYY + /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/, // DD/MM/YYYY + /^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/, // YYYY/MM/DD + /^\d{4}\.(0[1-9]|1[0-2])\.(0[1-9]|[12][0-9]|3[01])$/, // YYYY.MM.DD + /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])\s\d{2}:\d{2}:\d{2}$/, // YYYY-MM-DD HH:MM:SS + /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T\d{2}:\d{2}:\d{2}$/, // YYYY-MM-DDTHH:MM:SS (ISO-8601) ]; const TIME_FORMAT = [