Exclude an event if model has a certain state #19
Replies: 3 comments 5 replies
-
Okay, this was a quick one, but for documentation purposes: Just add a custom style: public function eventStyles(): array
{
return [
'hidden' => [
'display' => 'none'
],
]
} and on the if($event->model()->is_finished) {
$event->addStyle('hidden');
} |
Beta Was this translation helpful? Give feedback.
-
Ha, that's a nice creative css workaround :)! You can rely on it temporarily but it might break things in the future when the amount of events returned could potentially be used to calculate layout rules or something like that. I have an update in the works that allows real event hiding, stopping them from being relayed to the front-end, which fixes #12 and allows the developer to not relay events to the front-end based on whatever condition. It will be released within weeks. Until then, your solution is a nice work-around 👍 . |
Beta Was this translation helpful? Give feedback.
-
I have just released 1.3 with support for an |
Beta Was this translation helpful? Give feedback.
-
At the moment I'm including a
Task
model with anexpiration
date to the calendar, that works fine so far.However, I did not find an option in the docs that provides the possibility to exclude an event from the calendar.
I'm thinking about something like this (taken from the
README,.md
):Simply returning
null
does not work because anEvent
object has to be returned.If I'm not missing a simple thing and this is actually not possible at the moment than this would be a Feature Request ;-)
Beta Was this translation helpful? Give feedback.
All reactions