Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Preview: Event Calendar Module

Discuss all other Modules here.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Go to End
Author Topic: 40866 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    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

  • George
    Avatar
    Community Member
    41 Posts

    Re: Preview: Event Calendar Module Link to this post

    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.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

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

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Preview: Event Calendar Module Link to this post

    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

  • George
    Avatar
    Community Member
    41 Posts

    Re: Preview: Event Calendar Module Link to this post

    Thanks for the patch. ICS is now working.

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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

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

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Preview: Event Calendar Module Link to this post

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

    So far

    40866 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.