Specifying the “Start Date” and “Calendar Period” in the URL to a SharePoint calendar using Out-of-the-Box functionality

A friend asked me if there was a way to specify the start date for a calendar in SharePoint. The specific use case involved sending users to a shared SharePoint calendar and allowing them to list the events they are attending at a convention. The convention exists in the future, but upon navigating to the calendar, users are taken to today’s date. As such, users had to navigate to the date of the convention and then schedule their events.

SharePoint does not provide a way to limit the range of calendar events out-of-the-box. Like all things SharePoint, the calendar is a list; however, items in the list are displayed on top of an existing layer of data, or the pre-determined collection of “allowed” calendar dates, which consists of 365 days in each year, etc.

While there is no way to create a calendar in which this “allowed dates” set can be limited (without custom development), there is a way to send users directly to a specific date by modifying the URL to the calendar.

The default calendar URL looks something like this:

http://MySharePointSite/Lists/Calendar/calendar.aspx

By adding the following to the URL, you can specify the date range to show the user, as well as the “time period” (month/week/day) to display:

http://MySharePointSite/Lists/Calendar/calendar.aspx?CalendarDate=10/10/2011&CalendarPeriod=week

 

SharePoint Calendar
The aforementioned URL would direct the user to this view of the calendar.

Note: Query string parameters are added following a question mark (?); if more than one parameter is specified, additional parameters must be separated by an ampersand (&).

Placing a similarly-constructed URL on the Quick Launch sidebar gives us a way to quickly send users to a specific date range on the calendar list, and fits our use case quite nicely in that the calendar itself is not modified, but the user is directed to the dates on which the conference takes place.

Note that specifying “week” as the CalendarPeriod parameter will automatically display the work week to which the CalendarDate parameter belongs.  To modify the day/hour range of a standard work week, modify the Regional Settings from the Site Settings page.

Advertisements

5 Comments Add yours

  1. Francois says:

    Hi,

    Unfortunately, it doesn’t work…
    Items are not displayed in the fix date/week requested!

    A workaround to display these items is to go backward and forward through calendar arrows left/right and all items appears again.

    Do you have a solution for this issue?

    Thanks for your help!

    François

  2. Jay says:

    Awesome tip. Just was I needed.

  3. Lukas says:

    Hi!

    “calendar.aspx?CalendarDate=2011-11-02” is working fine. But if I open this link (Sp2010) no entries/events/items are displayed 😦

    (If I click on the next week and back I see all)

    Any ideas?

    thanks !

  4. jasmel says:

    calendar.aspx?CalendarDate=2011-11-02 change to calendar.aspx?CalendarDate=11/02/2011 like the example.

  5. mohsi\ says:

    i am using listViewWebPart and showing calender view, how i can pass CalendarDate parameter so that it always start with specific date? let me know even it is possible through code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s