prefer client timezone for site announcements

This commit is contained in:
cita
2026-03-20 14:06:11 +08:00
parent 1af1fe244a
commit f880e3a25f
4 changed files with 28 additions and 2 deletions
@@ -340,6 +340,17 @@ export function readClientTimeZone(): string | undefined {
}
}
export function resolveSiteAnnouncementTimeZone(
clientTimeZone?: string | null,
serverTimeZone?: string | null,
): string | undefined {
const client = String(clientTimeZone || '').trim();
if (client) return client;
const server = String(serverTimeZone || '').trim();
return server || undefined;
}
export function formatSiteAnnouncementSeenAt(
value: string | null | undefined,
timeZone = readClientTimeZone(),