From b416fd4581abfe736e15cb6063ff3023bc217e4b Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Thu, 11 Jan 2024 17:38:29 +0530 Subject: [PATCH] fix: time throws --- public/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/main.js b/public/main.js index 3ba5923..4f3df16 100644 --- a/public/main.js +++ b/public/main.js @@ -530,10 +530,12 @@ function displaySheetCards(sheets) { let sheetDescription = document.createElement("p"); sheetDescription.className = "card-text"; - sheetDescription.innerHTML = - "Modified " + - formatRelativeTime(new Date(sheet.modifiedTime)) + - ""; + if (sheet.modifiedTime) { + sheetDescription.innerHTML = + "Modified " + + formatRelativeTime(new Date(sheet.modifiedTime)) + + ""; + } sheetCardBody.appendChild(sheetTitle); sheetCardBody.appendChild(sheetDescription);