Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Module: removeStartFields and removeEndFields not working correctly

Go to End



Community Member, 15 Posts

9 August 2009 at 10:23am

I want to remove the start and end date selectors on the calendar widget. In my subclass of Calendar, I have put the following in getFilterFields():

		$fields = parent::getFilterFields(); // returns a CalendarFilterFieldSet
		// remove the date filters

This removes most of the date selectors, but leaves the end date month in the widget. I looked in the source of event_calendar/code/CalendarFilterFieldSet.php and discovered a typo on line 61 in the function definition for removeEndFields(). I fixed this, and the date selectors are now gone from the widget. However, the form still submits empty dates for start and end date, which results in the filters not returning the correct values. When I submit the widget's form, the URL contains '/--/--', so no events show up at all.

Any suggestions about the best way to resolve this? I could filter '/--/--' out of the URL, but this seems like a bug to me and better to fix in the event calendar module.