Skip to content

Commit

Permalink
fix: COMMON_TIME_FORMAT (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
longxiaofei authored Sep 26, 2023
1 parent 915b961 commit fe62b02
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/graphic-walker/src/lib/inferMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

1 comment on commit fe62b02

@vercel
Copy link

@vercel vercel bot commented on fe62b02 Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.