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

Event Calendar: the bug or the feature?


Go to End


8 Posts   1825 Views

Avatar
Victor

Community Member, 128 Posts

26 February 2010 at 8:32am

Edited: 26/02/2010 8:41am

We run our custom module built on the top of EC (DateTime with extra fields like Location, Speaker,....,Content) and observed the following behaviour: if the same Event has more than one occurrence in one single day (but different times) then clicking on see more displays all the occurrences of this date come out. Is it an expected behaviour?

Victor

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 February 2010 at 8:50am

Do you have a link?

Avatar
Victor

Community Member, 128 Posts

26 February 2010 at 8:59am

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 February 2010 at 9:11am

Can I see your template for CalendarEvent (or subclass thereof)?

Avatar
Victor

Community Member, 128 Posts

26 February 2010 at 9:20am

I cannot provide you with the "final" as one of our sysadmins changed my code to a certain degree but my own testsite exhibits the same behaviour

http://weyl.math.toronto.edu:8888/testsite/analysis-and-applied-math-seminar/2010-02-05

and I post it there

<% require css(event_calendar/css/calendar.css) %>
<% require javascript(event_calendar/javascript/calendar_core.js) %>
<script type="text/javascript" src="../mathjax/MathJax.js"></script>

<div id="primaryContent" class="clearfix">
    <div class="innerpad">
                <div id="calendar-sidebar">
                        <h3><% _t('Calendar.BROWSECALENDAR','Browse the Calendar') %></h3>
                        <div id="monthNav">
                                <p><% _t('Calendar.USECALENDAR','Use the calendar below to navigate dates') %></p>
                                $CalendarWidget
                                <h4><% _t('Calendar.FILTERCALENDAR','Fitler calendar') %>:</h4>
                                $CalendarFilterForm
                        </div>
                </div>
                <div id="calendar-main">
                        <div id="topHeading" class="clearfix">
                                <span class="back"><a href="$CalendarBackLink"><% _t('CalendarEvent.BACKTO','Back to') %> $Parent.Title</a></span>
                                <span class="feed"><a href="$RSSLink"><% _t('Calendar.SUBSCRIBE','Subscribe to the Calendar') %></a></span>
                                <h2>$Parent.Title</h2>
                        </div>

                        <% if Menu(2) %>
                        <% include SideBar %>
                        <div id="Content">
                        <% end_if %>

                        <% if Level(2) %>
                                <% include BreadCrumbs %>
                        <% end_if %>
</div>
<div>

<div class="event">
                                <% if OtherDates %>
                                <div id="additionalDates">
                                        <h4><% _t('CalendarEvent.LDATES','Dates') %></h4>
                                        <dl class="date clearfix">
                                        <% control Dates %>
                                                <dt><a href="$Link" title="$Event.Title">$_Dates</a> $Title, <% if SpeakerWebsite %><a href="$SpeakerWebsite"><% end_if %>$Speaker<% if SpeakerWebsite %></a><% end_if %>, $Institution</dt>

                                        <% end_control %>
                                        </dl>
                                <% end_if %>
</div>
<div>

                                <h3 class="summary">$Title</h3>

                                <% control CurrentDate %>
                                <h4><a href="$ICSLink" title="Add to Calendar">$_Dates</a></h4>

                                <% if StartTime %>
                                <ul id="times">
                                        <li>$_Times $Location, $Title, <% if SpeakerWebsite %><a href="$SpeakerWebsite"><% end_if %>$Speaker<% if SpeakerWebsite %></a><% end_if %>, $Institution</li>
<li>
$Abstract</li><li>$TeXAbstract</li>
                                </ul>
                                <% end_if %>
                                <% end_control %>

                                $Content
                                $Form
                                $PageComments
                        </div>
                                <% if Menu(2) %>
                                </div>
                                <% end_if %>

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 February 2010 at 9:27am

A couple things..

You're testing for OtherDates, but then you're controlling Dates. That doesn't make sense. Pick one or the other.

The way an Event template should work is that you have all of the Event properties available to you like so:

<h3>$Title</h3>

<h4>$SomeCustomProperty</h4>

Then, to show the date that was clicked by the user, you should use the CurrentDate control:

<% control CurrentDate %>$_Dates<% end_control %>

Next, you probably want to show any other dates that are associated with this event, that is, everything but the date that was clicked by the user.

<% control OtherDates %>$_Dates<% end_control %>

Make sense?

Avatar
Victor

Community Member, 128 Posts

26 February 2010 at 9:32am

BTW we also would like to have a "Print" button returning cropped page (without banners, navigations ... see attached file)

Avatar
Victor

Community Member, 128 Posts

26 February 2010 at 9:43am

Edited: 26/02/2010 9:45am

UC:

<% control OtherDates %>$_Dates<% end_control %>

Make sense?

Yes - I changed it but still the same behaviour as possibly CurrentDate means really "Current Date" not "Current Date-Time"

Victor