Jump to:

10448 Posts in 2223 Topics by 1719 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar: Using the jQuery UI DatePicker

Discuss all other Modules here.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 6347 Views
  • Anonymous user
    Avatar
    Community Member
    1 Post

    Event Calendar: Using the jQuery UI DatePicker Link to this post

    This hacking around here should no longer be needed, I just packed it into a normal widget: Event Calendar Widget

    This is a small modification for the great "Event Calendar" module. It will replace the default CalendarWidget with a version that is using the Datepicker widget from jQuery UI.

    The widget will request a list of events for the currently visible month. Subsequently, only dates which have at least one event associated with them are selectable.

    Unfortunately, the possibility to select months and weeks directly in the widget are gone. Maybe one could readd that feature with the Daterangepicker plugin.

    When downloading the archive, it should suffice to overwrite the current module folder with the provided one. For the patchfile, it is necessary to get all the image files from the archive (in the images/ and css/ui-smoothness/images/ folders).

    Unfortunately, the file management in the forum is messed up. I cannot remove the old jquery-ui.patch, so please ignore it.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Have you tried LiveCalendarWidget?

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Not sure I understand, so here are my guesses

    "Have you ever tried LiveCalendarWidget?"
    -- Yes, works great, but I do not see the point. Static is fine, events aren't changed that often.

    "Does this patch break LiveCalendarWidget?"
    -- No idea!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Well, the idea for LiveCalendarWidget was to deliver a calendar tool that was aware of your events. It does that by making an ajax call to the calendar page every time the month advances, so you always have information about which days have events. Plus, it breaks the widget out of client side generation and into the MVC pattern, so it's easy to customize and rebrand. May not work for you, but something else to look into.

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Ah, I see. That's a good idea, generally speaking, but since I usually have a bottleneck in latency and not bandwith, I try to avoid anything "Live" as much as possible and get all necessary data at once. But that's of course just my situation here.

    There is not much to this patch here, after all. I wanted to use the jQuery UI datepicker() for a more homogenous look with the rest of the widgets, and that's it.

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Coming to think of it, you're of course right: It is much cleaner to let the static calendar widget just display all days, and use the LiveWidgetCalender for the advanced stuff.

    It seems like this is easy enough to implement with the jQuery UI datepicker, I'll give it a try.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    Yeah, my experience is that it's pretty snappy, but I am on a fairly fast connection, too.

    Also, when you feed a static array to a calendar, you have to somehow provide limits on either end of the date range, but making a call to the database, you're always sure to get that set of months.

    I also wonder if a several asynchronous queries for one month are more better performing than one huge one up front?

  • Anonymous user
    Avatar
    Community Member
    1 Post

    Re: Event Calendar: Using the jQuery UI DatePicker Link to this post

    From my working experience, the fewer calls to the server a site makes, the faster it is. Unless you are talking about really huge amounts of data (in the 100KBs), the added latency will always outweigh the gains in download speed.

    Here is a cleaned up version of the CalendarWidget, with all the requirements bundled. It should behave as the standard version, minus the week selection.

    Attached Files
    6347 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.