Recently I wanted to create a filter for the calendar in sharepoint. What I was looking for, is having a filter that would show me the events from last week, and the events in the upcoming two weeks.

Too bad that the start date and end date of the calendar within sharepoint cannot be filtered. You simply cannot choose start date or end date within the filter options delivered by sharepoint. So how to still get the filter on the dates of the calendar?

Add two columns
Add two columns to the calendar. Say _startdate and _enddate. Make them both calculated fields, and assign ‘start date’ to ‘_startdate’ and ‘end date’ to ‘_enddate’. Make sure that both _startdate and _enddate return only ‘date’ and not ‘date and time’.

Filter the view
Alter / create the view in which you want to apply the date filter on the calendar. Now add a filter, and you’ll see you can select ‘_startdate’ and ‘_enddate’. For me, I used the following filter:

_enddate
is greater than or equal to
[Today]-7

AND

_startdate
is less than or equal to
[Today]+14

This ensures me that I now get to see all events from the last seven days, up to the next 14 days, including re-occurring events.

This entry was posted in Microsoft Development and tagged by Richard Zaat. Bookmark the permalink.
Richard Zaat

About Richard Zaat

Richard Zaat is oud-medewerker van Info Support. Zijn blogposts zijn dan ook gesloten voor comments.

5 thoughts on “Sharepoint calendar date filter

  1. Richard,

    Thanks for this, it was very helpful! However, I’ve run into a snag – when doing as you say, it doesn’t quite work. It shows all recurring meetings, not just the ones that fall within the bounds set by the filter (this is because they all start earlier than [Today]+14) and shows their start/end times as the full duration of the recurring meeting (for example, 1/1/2010 to 12/28/2010) rather than showing each individual instance of that recurring meeting within the bounds desired.

    Is there a way to work around this? Changing the filter to _startdate for both the greater than/less than works to show all the non-recurring meetings within that span of time, but the recurring meetings are excluded.

    Any help you can provide would be really appreciated!

  2. I don’t see an option to return only Date from calculated column, only Date and Time.

  3. Tony,

    When you select ‘Date and time’, Sharepoint will ask you another question, which is whether you want date and/or time returned.