From 42aa7898d5dfdee8017df5ec408cff326bba4d1f Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:03:46 +0100 Subject: [PATCH] fix: removed date filters previously set with getCalendarResults (#487) --- src/components/ItaliaTheme/Blocks/Calendar/Item.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ItaliaTheme/Blocks/Calendar/Item.jsx b/src/components/ItaliaTheme/Blocks/Calendar/Item.jsx index 3a45983eb..004854f8d 100644 --- a/src/components/ItaliaTheme/Blocks/Calendar/Item.jsx +++ b/src/components/ItaliaTheme/Blocks/Calendar/Item.jsx @@ -40,6 +40,11 @@ const Item = ({ day, path, query, inEditMode, data }) => { const dayStart = _day.startOf('day').format('YYYY/MM/DD HH:mm'); const dayEnd = _day.endOf('day').format('YYYY/MM/DD HH:mm'); + // remove date filters previously set for getCalendarResults in Body + const filtersWithoutDate = query.query.filter( + (el) => !el.o.includes('.date.'), + ); + useDeepCompareEffect(() => { dispatch( getCalendarDayResults( @@ -47,7 +52,7 @@ const Item = ({ day, path, query, inEditMode, data }) => { { ...query, query: [ - ...query.query, + ...filtersWithoutDate, { i: 'start', o: 'plone.app.querystring.operation.date.between',