I am trying to count the number of calendar events between a date range. That by itself is not difficult but there is one condition to my counter. I only need to add 1 point for calendar days that have at least 1 event created for it. I am having a hard time figuring out how to do this using the current structure. I am using the Bubble Full Calendar plugin and I have a feature to allow users to click on a day and add an event to it.
The full calendar plugin displays a Database object according to some date field to display it on the calendar. So what you want is a counter of all the events created by an user on a date range, correct?
If I’m understanding correctly then you only need to make a search for those events and filter them by a date range, and then just display the count.
In this example, the counter is displaying only the “events” whose date are inside the date range of start of November 2018 up to current date, as you can see in the calendar, it’s only one.
Thats part one. The second part of it is, if you add another event to Nov 24th and a different time for example 5:25 pm, you would now have 2 events on Nov 24th, 1 at 4:25 and another at 5:25. I need the count to still be 1 because the count represents if any events exist on each day inside of the date range.
Got it, I don’t know if a simpler solution exists, but I just figure it out with this method.
You will use the first filter I posted before, and add a grouping by days, that way you first filter by events happening only in the date range, and then group those events by day, making the text element display the count of groups (which in this case is the same as “days”).
Here is the final result in my example, as you can see, the set up looks for the events, then group them and then count them, we used a number input to show how it can work with dynamic values. Also by using an aggregation, you can display (like us in the repeating group) not only the days in which an event or more are contained, but the no. of events that day: