Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(app): format google calendar times in user's local timezone

Louis Beaumont0ad594a4b602
diff --git a/apps/screenpipe-app-tauri/components/settings/google-calendar-card.tsx b/apps/screenpipe-app-tauri/components/settings/google-calendar-card.tsx
index 724877a65..89f3aa60d 100644
--- a/apps/screenpipe-app-tauri/components/settings/google-calendar-card.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/google-calendar-card.tsx
@@ -110,7 +110,25 @@ export function GoogleCalendarCard() {
}
);
if (res.ok) {
- const events: CalendarEventItem[] = await res.json();
+ const raw: CalendarEventItem[] = await res.json();
+ // format display times in user's local timezone
+ const events = raw.map((e) => ({
+ ...e,
+ startDisplay: e.start
+ ? new Date(e.start).toLocaleTimeString("en-US", {
+ hour: "numeric",
+ minute: "2-digit",
+ hour12: true,
+ })
+ : "",
+ endDisplay: e.end
+ ? new Date(e.end).toLocaleTimeString("en-US", {
+ hour: "numeric",
+ minute: "2-digit",
+ hour12: true,
+ })
+ : "",
+ }));
setUpcomingEvents(events.filter((e) => !e.isAllDay).slice(0, 5));
} else {
setUpcomingEvents([]);