From 27cc78ede509335e8e0e63ed33fa5f178ca26897 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 8 Jun 2026 11:09:19 -0400 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/layouts/entry-page/entry-page.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 117d1e81..1ac3d664 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -279,22 +279,27 @@ export default { } }, formatToYYYYMMDD(dateString) { - var returnValue = null; - try { - // Avoid any UTC / local time issues by always treating the input and output as UTC. + if (!dateString) { + return null; + } + + // Avoid any UTC / local time issues by always treating the output as UTC. const date = new Date(dateString); + if (Number.isNaN(date.getTime())) { + return null; + } const year = date.getUTCFullYear(); const month = String(date.getUTCMonth() + 1).padStart(2, "0"); const day = String(date.getUTCDate()).padStart(2, "0"); - returnValue = `${year}-${month}-${day}`; + return `${year}-${month}-${day}`; } catch ( error ) { global.$logger.logError(`[Entry Page] Error formatting date string: ${error} - Input: ${dateString}`); + return null; } - - return returnValue; + } } } };