Skip to content

Commit

Permalink
Fix datetime detection
Browse files Browse the repository at this point in the history
  • Loading branch information
crackedmind committed May 27, 2022
1 parent 25ab99a commit fd0fdc0
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 fd0fdc0

Please sign in to comment.