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): load events for all visible days of calendar month (#3216)

Meier Lukas437ecd10239c
diff --git a/packages/request-handler/src/calendar.ts b/packages/request-handler/src/calendar.ts
index 55918eaaf..dd198912a 100644
--- a/packages/request-handler/src/calendar.ts
+++ b/packages/request-handler/src/calendar.ts
@@ -13,8 +13,10 @@ export const calendarMonthRequestHandler = createCachedIntegrationRequestHandler
>({
async requestAsync(integration, input) {
const integrationInstance = await createIntegrationAsync(integration);
- const startDate = dayjs().year(input.year).month(input.month).startOf("month");
- const endDate = startDate.clone().endOf("month");
+ // Calendar component shows up to 6 days before and after the month, for example if 1. of january is sunday, it shows the last 6 days of december.
+ const startDate = dayjs().year(input.year).month(input.month).startOf("month").subtract(6, "days");
+ const endDate = dayjs().year(input.year).month(input.month).endOf("month").add(6, "days");
+
return await integrationInstance.getCalendarEventsAsync(
startDate.toDate(),
endDate.toDate(),