Jump to:

10990 Posts in 2727 Topics by 1818 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: 41529 Views
  • dreamstudio
    Avatar
    Community Member
    48 Posts

    Re: Preview: Event Calendar Module Link to this post

    Couple of things im having trouble with

    Got the event module into the site and reworked the css and templates to match my design, however the fonts for content and text / links isnt the same and cant see where in the CSS it needs changing, I have looked at calendar.css but nothing stands out

    Also on the configuration for the module, I have set the number of future dates to 0 or 1 or anything but it just seems to display the next 4 even though the event is weekly. Is there another way to change how many it shows?

    finally... when it shows "see also" and then lists the next 3 dates for it, is there a way to change how many it shows for this ie just one

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Not sure about the CSS question. You'll have to be a little more specific. There are no font-family properties declared in calendar.css -- just sizes and weights. You can always override styles using the !important flag to trump any inheritance. Firebug is also useful in showing an elements inherited properties.

    The future dates field is for the "see also" section. If your event has many dates, it will list them all there. If it's a recurring event, however, it needs a place to stop. That's what that field is for. Entering 3 in the future dates field will limit the see also section to show the next 3 recurring dates. There is no way to limit the number of recurring events that show in your main calendar view. It will show all the events, recurring or not, that fall in the selected date range.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Just working on the localisation features. Can anyone confirm that this translation is correct?

    M-D-Y: Oct. 6-8, 2009

    D-M-Y: 6-8 Oct. 2009

    Something doesn't look right. Do I need a comma after the Oct?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Preview: Event Calendar Module Link to this post

    I'd probably write
    6.-8. Oct., 2009

    Quite a lot of punctuation though

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Okay, and for a span across multiple months:

    M-D-Y: Oct. 30 - Nov. 1, 2008

    D-M-Y: 30 Oct. - 1 Nov, 2008

    Correct?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Preview: Event Calendar Module Link to this post

    Usually one writes a period after the number (at least in German. This actually has the same meaning as the "st", "nd", "th" suffixes in the English language).
    Therefore I'd write:
    30. Oct. – 1. Nov., 2008

    Maybe you could simply setup sprintf templates in the translation array?
    Then you could use something like:

    $template = _t("CalendarModule.MultiMonthTemplate","%s. %2d - %s. %2d, %4d");
    $formattedDate = sprintf($template, strftime('%b', $startDate), date('d', $startDate), strftime('%b', $endDate), date('d', $endDate), date('Y', $endDate);

    This is most likely not the fastest approach, but now every language/locale could have its own template.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Preview: Event Calendar Module Link to this post

    Bleh. Disgregard what I wrote there. The sprintf parameters would require re-organization as well.
    But I think some sort of locale aware template for the date-string would still be the best choice.

    Edit: Something like this would be awesome: http://doc.qtsoftware.com/4.5/qstring.html#arg
    This has nothing to do with Dates and PHP though, just with translations and place-holders

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Okay, guys, I just checked in a bunch of localization features. Next will be the translations.

    This is largely untested, but I'm working with the maxim "Publish early and often" to hopefully get some feedback.

    In your _config.php, you can now set:

    CalendarDateTime::set_param('date_format','dmy');

    Some new ways of tapping into the date templates:

    CalendarDateTime::set_param('month_format_character', '%B'); // default is %b
    CalendarDateTime::set_param('year_format_character', '%y'); // default is %Y
    CalendarDateTime::set_param('month_header_format_character', '%b');
    // etc..

    Where _header_ parameters are for dates drawn in the calendar header (magically generated based on the date range you choose), and the standard format_character parameters are for all other magically drawn dates.

    Note: The format characters are based on the strftime() PHP function -- not date() (thank you, Banal).

    And as always, you can always tap into $StartDate.Format(xyz) and $EndDate.Format(xyz)

    Let me know how it works for you. Like I said, only VERY lightly tested.

    41529 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.