refs #13828 Merge branch 'origin/13828-trash-view'
[arvados-workbench2.git] / src / common / formatters.ts
index 0402f3903763e75ac04ee16c555f05d787cbbc77..e2097878a9f98276ffe1d78cf49ac6ca4468d894 100644 (file)
@@ -2,10 +2,13 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-export const formatDate = (isoDate: string) => {
-    const date = new Date(isoDate);
-    const text = date.toLocaleString();
-    return text === 'Invalid Date' ? "" : text;
+export const formatDate = (isoDate?: string) => {
+    if (isoDate) {
+        const date = new Date(isoDate);
+        const text = date.toLocaleString();
+        return text === 'Invalid Date' ? "" : text;
+    }
+    return "";
 };
 
 export const formatFileSize = (size?: number) => {