Emergency fixes on prod

This commit is contained in:
James Pattinson
2026-06-28 08:35:39 +00:00
parent 5e12561fb2
commit 870bc0649b
4 changed files with 74 additions and 17 deletions
+9 -2
View File
@@ -631,8 +631,15 @@
if (!utcDateTimeString) return '';
try {
// Parse the ISO datetime string
const date = new Date(utcDateTimeString);
// API datetimes are UTC; normalize naive strings before local display.
let utcDateStr = utcDateTimeString;
if (!utcDateStr.includes('T')) {
utcDateStr = utcDateStr.replace(' ', 'T');
}
if (!/[zZ]|[+-]\d{2}:\d{2}$/.test(utcDateStr)) {
utcDateStr += 'Z';
}
const date = new Date(utcDateStr);
// Check if valid date
if (isNaN(date.getTime())) {