- Issue created by @mortona2k
- πΊπΈUnited States m.stenta
I just stumbled across the same issue, and discovered the solution. The commit you pointed to @mortona2k changed the way the base style plugin works, so that now it assumes you will add two date offset filters to your View. The style plugin will then automatically modify those filters to adjust the offset based on the current state of the calendar.
So for example, I have a calendar by month. I needed to add two filters to my View:
1. Filter by timestamp with an "offset" greater than or equal to "-1 month".
2. Filter by timestamp with an "offset" less than or equal to "+1 month".This serves to load all entities in the current month, as well as entities in the previous and next months. It's important to load 3 months like this, because sometimes the current month view shows a few days of last/next month at the beginning/end.
This is documented on the project page, but I didn't notice that at first. Maybe it could be improved. It also links to https://www.drupal.org/docs/contributed-modules/calendar-view/recurring-... β , which is specifically for "recurring events", which I do not have, so I found that confusing and wasn't sure if it was relevant to me at first.
Hope this helps someone else!
- Status changed to Closed: works as designed
6 months ago 8:53pm 17 August 2024 Thank you for opening this issue @mortona2k.
There was indeed an attempt to filter the calendar view at the View's query level with the
query()
method but it was very tricky and prompt to errors - in particular in combination with smart_date module and other date fields provided by other modules - with the table name and/or suffix (e.g. missing or extra suffix_value
...etc).After many trials, I decided to remove the filtering with
query()
. The site builder is in charge of building a sustainable View (i.e. do not try to load thousands of recurring events π±).There is a documentation page about setting the filters with an offset value such as
-1 month
and+1 month
.I hope it is clear now. Let me know if I can help explaining more architectural decisions.