Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Event calendar

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2415 Views
  • Mackodlak
    Avatar
    Community Member
    95 Posts

    Re: Event calendar Link to this post

    Oh, nice, and what about that issue of swapping sunday to be the last day in the week? That is to complicated to do?

  • Mackodlak
    Avatar
    Community Member
    95 Posts

    Re: Event calendar Link to this post

    I'm sorry if I'm boring, but I don't have anywhere else to ask how to do this and it has to be done...
    Any1 has any idea how to swap sunday to be the last day of the week?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event calendar Link to this post

    It's not easy. I've tried to add that option, and it's just a lot of work. I welcome you to give it a shot and submit a pull request, however.

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • Mackodlak
    Avatar
    Community Member
    95 Posts

    Re: Event calendar Link to this post

    Haven't rly managed to do it yet, but have another problem now -
    live calendar widget had a dropdown menu to select a month and such, but there are also 2 arrows for going on previous and next month.
    The problem is they aren't working for me for some reason, well they do, but instead just changing the month in live calendar widget, they move to completly new page with only calendar of the previous/next month shown.

    Also, since I've started using the live calendar widget, the calendar on calendar page isn't shown ever (it never loads, prolly cause it would mean there would be 2 calendars shown on same page, and that seems to bothers him)

    Any ideas?

  • Mackodlak
    Avatar
    Community Member
    95 Posts

    Re: Event calendar Link to this post

    Hello, It's me again.

    I have put the calendar aside, since I have managed to fix css/display of LivecalendarWidget so it is fine by my boss. However, now it turns out they rly aren't happy with sunday being the first day of the week and I have been trying to swap it to last day of the week.
    The first thing I have found out about it is tha inside sfTime.class.php there is the following:

       /**
        * Days of the week
        */
       const SUNDAY   = 0;
       const MONDAY   = 1;
       const TUESDAY   = 2;
       const WEDNESDAY   = 3;
       const THURSDAY   = 4;
       const FRIDAY   = 5;
       const SATURDAY   = 6;

    and I thought if I play with the numbers here I would manage to swap the days a bit, but doing so only swaps the day names of the columns in LiveCalendarWidget.
    Do you know how I can play with the actual day number in the widget? As a help. I will try to add the option, or make a one-time swap for my needs if that is ok with you?

  • Mackodlak
    Avatar
    Community Member
    95 Posts

    Re: Event calendar Link to this post

    I can see in the documentation it was once as I need it to be now:

    http://doc.silverstripe.org/old/modules:event_calendar#modifying_the_template

    in the displayed livecalendarwidget there is clearly monday as first day of the week and saturday and sunday come as last.
    I guess you hardcoded it to not be like that any more for US display or whatever, but if it's not 2 much to ask can you tell me how to switch it back?
    I rly don't need it as an option since it won't be done more then once, just a one time deal.

    Thank you

    EDIT: am looking at javascript and there seem to be the most important things about deciding which day of the week is first, but changing any info doesn't do much:

    jquery.date.js has in itself the following:

    /**
    * The first day of the week for this locale.
    *
    * @name firstDayOfWeek
    * @type Number
    * @cat Plugins/Methods/Date
    * @author Kelvin Luck
    */
    Date.firstDayOfWeek = 1;

    suggesting the first day of the week should be monday (acorging the alrdy mentioned above from sunday value = 0 to saturday = 6).
    However aparently it is still sunday = 0 the first day of the week.

    Changing this value doesn't do anything.

    Then in jquery.Datepicker.js there is the following:

                var start_of_week;
                var end_of_week;
                for (var i=0; i<7; i++) {
                   strDate = currentDate.getFullYear() + '-' + this._zeroPad(currentDate.getMonth()+1) + '-' + this._zeroPad(currentDate.getDate());
                   if(i == 0) start_of_week = strDate
                   if(i == 6) end_of_week = strDate;
                   var thisMonth = currentDate.getMonth() == month;

    playing with if(i==0) start_of_week = strDate; and if(i==6) end_of_week = strDate; (0 being sunday, 6 being saturday) and changing it (0 to 1 and 6 to 0) also does nothing

    I'm not sure why, i was sure it would atlest show some kind of a change, if nothing else then to screw up the whole calendar.

  • sube1even
    Avatar
    Community Member
    1 Post

    Re: Event calendar Link to this post

    hi unclecheese,

    is it possible to have dates for multiple calendars show in the live calendar widget without adding to the feed...

    2415 Views
Page: 1 2
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.