Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jeremy-Z 2026-06-08 11:09:19 -04:00 committed by GitHub
parent 843caaf01f
commit 27cc78ede5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}
}
};