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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Preview: Event Calendar Module


Go to End


293 Posts   69246 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

6 April 2009 at 4:59am

1) I took out $MonthNavigator, because I assumed no one was using it, and it seemed redundant to the CalendarWidget. I've put it back in an done a little code cleanup on it.

2) To change the date display is not the most user-friendly thing in the world, but it's very flexible. In your _config.php file, edit the $customDateTemplates array. You can change any one of the following date scenarios:

- OneDay
- SameMonthSameYear
- DiffMonthSameYear
- DiffMonthDiffYear
- OneDayHeader
- MonthHeader
- YearHeader

"Header" keys are for the date range headers that are displayed when a range is selected. All others apply to each event listing, specifying different scenarios, e.g. if an event spans several days in the same month, you want something like "Oct 6-8, 2009" (US format).

You'll find a bunch of date format keys in the _config.php file that you can use to build your own. To make the update you want, you can do something like:

$customDateTemplates = array (
'OneDay' => '%{sWeekDayFull}, %{sMonFull} %{sDayNumShort}%{sDaySuffix}, %{sYearFull}'
);

If you plan on having dates that span multiple days, you should spec out the other keys for "SameMonthDiffDay", etc.. Otherwise, it falls back on the lang file.

3) First, you need to read the documentation on extending the calendar. There's a good recipe in the Wiki. Once you've done that you can build a custom Events function that might look like this:


class MyCustomCalendar_Controller extends Calendar_Controller
{
public function FundRaisingEvents()
{
return parent::Events("Type = 'Fundraising');
}
}

We did something like that on this site: www.vmec.org/workshops

Avatar
George

Community Member, 41 Posts

7 April 2009 at 9:04am

Hello UncleCheese

I have an event_calendar (latest trunk) with SS 2.3.1 named events. Only announcements are saved.
When I make an ICS export I got as subject the name of the calendar (events).
It seems that 'SUMMARY' in the ICS-file is not correctly written with the title of the announcement, it is written with the name of the calendar.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

7 April 2009 at 9:17am

Great catch. I think I see the bug. I'll patch it and check in a new version as soon as I can.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 April 2009 at 2:10am

I've patched the bug with announcements in the ICS in the latest version.

Avatar
Victor

Community Member, 128 Posts

8 April 2009 at 2:45am

Actually it also fixed Missing Time on CalendarEvent:
Still

1) in blackcandy it is not correctly aligned

http://weyl.math.toronto.edu:8888/SilverStripe/test-calendar/2009-04-06

2) no time display on Calendar

Avatar
George

Community Member, 41 Posts

8 April 2009 at 10:58am

Edited: 08/04/2009 10:59am

Thanks for the patch. ICS is now working.

But I have the same problem, that time is not anymore shown.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 April 2009 at 1:09pm

Make sure your template is not using <% control Times %> .. that's deprecated. Just use $_Times.

Avatar
Victor

Community Member, 128 Posts

8 April 2009 at 1:21pm

In Calendar.ss (r18) still was <% if Times %> and <% Control Times %>
Removing them put time into Diary page

So far

Go to Top