fix(calendar): load events for all visible days of calendar month (#3216)
This commit is contained in:
@@ -13,8 +13,10 @@ export const calendarMonthRequestHandler = createCachedIntegrationRequestHandler
|
|||||||
>({
|
>({
|
||||||
async requestAsync(integration, input) {
|
async requestAsync(integration, input) {
|
||||||
const integrationInstance = await createIntegrationAsync(integration);
|
const integrationInstance = await createIntegrationAsync(integration);
|
||||||
const startDate = dayjs().year(input.year).month(input.month).startOf("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 endDate = startDate.clone().endOf("month");
|
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(
|
return await integrationInstance.getCalendarEventsAsync(
|
||||||
startDate.toDate(),
|
startDate.toDate(),
|
||||||
endDate.toDate(),
|
endDate.toDate(),
|
||||||
|
|||||||
Reference in New Issue
Block a user