fix(notification-history): correct date formatting to handle UTC properly

This commit is contained in:
Sam Chau
2025-12-30 05:26:40 +10:30
parent bf1ccb956d
commit f63188082c

View File

@@ -6,7 +6,9 @@
export let services: Array<{ id: string; name: string }>;
function formatDateTime(date: string): string {
return new Date(date).toLocaleString();
// SQLite stores as UTC without timezone indicator, append Z to parse correctly
const utcDate = date.endsWith('Z') ? date : date.replace(' ', 'T') + 'Z';
return new Date(utcDate).toLocaleString();
}
function getServiceName(serviceId: string): string {