Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(utils): add relative time formatting helper

Steven Enamakel13e68bc339d4
diff --git a/app/src/utils/relativeTime.ts b/app/src/utils/relativeTime.ts
index 58a929602d..e2a89a803a 100644
--- a/app/src/utils/relativeTime.ts
+++ b/app/src/utils/relativeTime.ts
@@ -37,9 +37,14 @@ export function relativeTime(at: Date, now: Date, locale?: string): RelativeTime
/** Full local date and time with the zone, for a tooltip. */
export function fullTimestamp(at: Date, locale?: string): string {
if (Number.isNaN(at.getTime())) return '';
+ // Explicit fields: `dateStyle`/`timeStyle` cannot be combined with
+ // `timeZoneName`, and the zone is the point of the tooltip.
return new Intl.DateTimeFormat(locale, {
- dateStyle: 'medium',
- timeStyle: 'short',
+ year: 'numeric',
+ month: 'short',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: '2-digit',
timeZoneName: 'short',
- } as Intl.DateTimeFormatOptions).format(at);
+ }).format(at);
}