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?
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?
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
}
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
From a list of events I passed the startdate as a querystring something like:
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!
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?
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:
/Chriztian
I have now added two new functions to the project. They are included in the new 0.1.7.4 release.
These are
and
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.
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
is working on a reply...
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.