2

Is it possible in SharePoint 2010 to access a particular date of a calendar through a link? As far as I could see it right now, switching to the Day view happens through AJAX, and no URL parameters can be provided. What I want to achieve is to open a URL and provide a date with it, and have that particular date displayed for my calendar

2

Rene, you can do it with Javascript/jQuery.

Pass the date in the querystring. Then in a CEWP, feed that into the built-in Javascript date change function on page load.

I used SPServices for getting the querystring, but you don't have to do that:

var queryStringVals = $().SPServices.SPGetQueryString(),
    calView = queryStringVals.view || "",
    calDate = queryStringVals.date || "";

jQuery(document).ready(function($) {

    if (calDate != '') ClickDay(calDate);

});

Then, just pass the date like this: /calendar.aspx?date=4%2f25%2f2013

Changing views (from month to day to week) could be accomplished the same way. You just need to find the function that does that... I've assumed you would do that in my querystring getter.

  • 1
    Thanks Jim! Was hoping that it was somehow possible to achieve it without additional coding. But as one can see from your coding, it's fairly easy to do it with a little JavaScript (I'm a bit confused now that I didn't look at that option last year). – Modery Apr 27 '12 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.