Force date formatting to stay in UTC.

This commit is contained in:
Jeremy-Z 2026-06-05 15:01:10 -04:00
parent d2f9ea3bea
commit 53fb11e9c2

View file

@ -282,11 +282,12 @@ export default {
var returnValue = null; var returnValue = null;
try { try {
// Avoid any UTC / local time issues by always treating the input and output as UTC.
const date = new Date(dateString); const date = new Date(dateString);
const year = date.getFullYear(); const year = date.getUTCFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0"); const month = String(date.getUTCMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0"); const day = String(date.getUTCDate()).padStart(2, "0");
returnValue = `${year}-${month}-${day}`; returnValue = `${year}-${month}-${day}`;
} catch ( error ) { } catch ( error ) {