Add hour and minute to comment timestamps on issue pages

Comments now show localized date+time (e.g. "Feb 20, 2026, 2:15 PM")
instead of just the date. Added formatDateTime utility to keep the
existing date-only formatDate unchanged for other contexts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-20 16:19:54 -06:00
parent 95f0d36adc
commit 40512ad533
2 changed files with 12 additions and 2 deletions

View File

@@ -17,6 +17,16 @@ export function formatDate(date: Date | string): string {
});
}
export function formatDateTime(date: Date | string): string {
return new Date(date).toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric",
hour: "numeric",
minute: "2-digit",
});
}
export function relativeTime(date: Date | string): string {
const now = Date.now();
const then = new Date(date).getTime();