consolodating date logic

This commit is contained in:
2024-08-24 15:46:21 -06:00
parent 446889206f
commit 368a438daa
6 changed files with 34 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
export const getDateFromString = (value: string) => {
// may need to check for other formats
const validDateRegex =
/\d{2}\/\d{2}\/\d{4} [0-2][0-9]|[0-5][0-9]|[0-2][0-9]:[0-5][0-9]:[0-5][0-9]/;
/\d{2}\/\d{2}\/\d{4} [0-2][0-9]:[0-5][0-9]:[0-5][0-9]/;
if (!validDateRegex.test(value)) {
return undefined;
}