Skip to content

Commit

Permalink
Merge pull request #89 from crackedmind/fix_datedetection
Browse files Browse the repository at this point in the history
Fix datetime detection
  • Loading branch information
hiranthaR committed May 29, 2022
2 parents 25ab99a + fd0fdc0 commit c0e5ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const snakeToCamel = (text: string) => text.replace(
* @returns true if include supported formats.
*/
export function isDate(date: string): boolean {
const datePattern = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(Z|[\+-]\d{2}:?\d{2})?$/gm;
const datePattern = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d*))(Z|[\+-]\d{2}:?\d{2})?$/gm;
return datePattern.exec(date) !== null ? true : false;
}

Expand Down

0 comments on commit c0e5ee8

Please sign in to comment.