diff --git a/src/widgets/calendar/component.jsx b/src/widgets/calendar/component.jsx index d1ab2b4b8..0e10d0ed3 100644 --- a/src/widgets/calendar/component.jsx +++ b/src/widgets/calendar/component.jsx @@ -52,15 +52,18 @@ export default function Component({ service }) { // params for API fetch const params = useMemo(() => { - if (!showDate) { - return {}; + const constructedParams = { + start: "", + end: "", + unmonitored: false, + }; + + if (showDate) { + constructedParams.start = showDate.minus({ months: 3 }).toFormat("yyyy-MM-dd"); + constructedParams.end = showDate.plus({ months: 3 }).toFormat("yyyy-MM-dd"); } - return { - start: showDate.minus({ months: 3 }).toFormat("yyyy-MM-dd"), - end: showDate.plus({ months: 3 }).toFormat("yyyy-MM-dd"), - unmonitored: "false", - }; + return constructedParams; }, [showDate]); // Load active integrations