Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix(calendar): some timezones result in offset of one day (#3120)

Meier Lukasb86159ba7c1c
diff --git a/packages/widgets/src/calendar/component.tsx b/packages/widgets/src/calendar/component.tsx
index b149bbc83..45e48bde2 100644
--- a/packages/widgets/src/calendar/component.tsx
+++ b/packages/widgets/src/calendar/component.tsx
@@ -124,9 +124,13 @@ const CalendarBase = ({ isEditMode, events, month, setMonth, options }: Calendar
)?.date,
}))
.filter((event): event is CalendarEvent => Boolean(event.date));
+
return (
<CalendarDay
- date={new Date(tileDate)}
+ // new Date() does not work here, because for timezones like UTC-7 it will
+ // show one day earlier (probably due to the time being set to 00:00)
+ // see https://github.com/homarr-labs/homarr/pull/3120
+ date={dayjs(tileDate).toDate()}
events={eventsForDate}
disabled={isEditMode || eventsForDate.length === 0}
rootWidth={width}