Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    May 31, 2016 @ 09:31
    Chriztian Steinmeier
    0

    Displaying a single item in KS Calendar

    Hi - awesome package!

    What are people doing when showing a specific item in a calendar with regards to showing the start- and endDate properties?

    E.g., if I'm on the template for a CalendarEvent - how do you determine which recurring event to show the date(s) for? Do you put the startDate in the URL? (e.g. /calendar/2016/05/31/interesting-event/)

    And related to that: Is that also the way to link to a specific event? I guess NiceUrl() / event.content.Url would just link to the event with no date-specifics, right?

    /Chriztian

  • Barry 7 posts 94 karma points MVP c-trib
    May 31, 2016 @ 13:21
    Barry
    1

    From a list of events I passed the startdate as a querystring something like:

    '@e.content.Url' + '[email protected](e.startDate.ToString())'
    

    Example from use with fullcalendar.io

    Which means you at least know the start date for repeating events and so on.

    Of course, that may not work in all use cases!

  • Ole Martin Bakke 112 posts 624 karma points
    May 31, 2016 @ 14:46
    Ole Martin Bakke
    0

    Hi, To be hones I haven't though about this. The package was created to show events in a list. I don't have a better idea for you, than passing the date with a querystring or some custom route or something.

    But if you have a specific need I can make a function or two to help you out. I could make a function returning the next occurance of an event based on an Id (or an Id and a startdate). And I can make a function retuning a list of occurences based on an Id and a startdate. Would that help you out or do you have a better approach?

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    May 31, 2016 @ 17:51
    Chriztian Steinmeier
    0

    Hi Ole - thanks for getting back to me on this!

    What I've currently done myself is to add a date param in the URL, and then in an extension (I use XSLT) I do a call to Calendar.getEvents() using that date and the page's parent's ID, then do some filtering to get the one I need - so yes, a way to get a specific event's dates would be great. It's always nicer to have the Calendar itself serve the right one(s) than trying to manipulate its output :-)

    So something like this would be super handy:

    Calendar.getEvents(int Id, DateTime date)
    {
        // Return events with Id, ocurring any time on date
    }
    

    /Chriztian

  • Ole Martin Bakke 112 posts 624 karma points
    Jun 02, 2016 @ 19:27
    Ole Martin Bakke
    100

    I have now added two new functions to the project. They are included in the new 0.1.7.4 release.

    These are

    getNodeEvents(DateTime date, int nodeId, string propertyType, bool splitNoneRecurring = true)

    and

    getNodeEvents(DateTime startDate, DateTime endDate, int nodeId, string propertyType, bool splitNoneRecurring = true)

    Both takes an event nodeId as a parameter and returns a list of occurances of that event on a given date or in a given timespan.

    If you have made changes to some of the files in the package, all the changes are in the dll-file.

    There are also a minor change in the backoffice-files, hiding some labels on empty content.

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jun 02, 2016 @ 20:16
    Chriztian Steinmeier
    0

    Hi Ole,

    That's brilliant — perfect! I'll check them out right away.

    Thanks!

    /Chriztian

    PS: I sent a pull request with an updated language file for Danish to include in a future update. This is such a great Property Editor for Umbraco 7.

    #h5yr

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies