What properties are available for Event?

This package works quite well, and is by far the most complete of the available scheduling scripts I’ve found out there on the Web.

However, as I am quite new to javascript, I’m running into some walls when it comes to understanding some of the details. Specifically, the documentation for filtering is extremely sparse. It offers no context about what is actually happening, and what is being referenced in the process.

scheduler.filter_week = function(ev_id, event){ if(event.name == 'New event') return false; // event will be filtered (not rendered) //or return true; // event will be rendered
The example helps me to understand that the filtering capability exists and where it should be used, but it isn’t thorough enough to tell me what else could be used to filter events.
What other properties are available with “event”, and what do they actually refer to?

For some context of my own, I am attempting to use the calendar to track a regular rotation of appointments. Interspersed among these recurring events are multi-day projects with the text “DEADLINE: (subject)”. Within the agenda view, I am attempting to filter out all events except for the ones that begin with “DEADLINE:”.

How do I create a filter based on the event’s text content?

Thanks so much for your efforts!

Hello,

By default each event have 3 properties: start_date, end_date, text. But you are absolutely not limited by them and most likely you are loading some of your own, for example: user_id, type and so on.

Now filter function as incoming parameters receives event_id and event object. And event object contains all those event properties. So you can build filter logic around them. For example:

scheduler.filter_week = function(ev_id, event){ if(event.type == 'Training') return false; // event will be filtered (not rendered) if(event.start_date < new Date()) return false; // start date in the past, event won't be displayed
In your case you can check if event.text contains ‘DEADLINE’ part.

Kind regards,
Ilya