1

I've seen numerous articles on how to get recurring events for the year, month, week or day. However, it appears that when using <Year /> the CalendarDate in QueryOptions is ignored.

In the below code, if I replace <Year /> with <Month /> then it respects the CalendarDate but with <Year /> it does not.

Any idea why?

<ViewFields>
    <FieldRef Name='Title' />
    <FieldRef Name='EventDate' />
    <FieldRef Name='EndDate' />
    <FieldRef Name='Location' />
    <FieldRef Name='Description' />
    <FieldRef Name='fRecurrence' />
    <FieldRef Name='RecurrenceData' />
    <FieldRef Name='fAllDayEvent' />
</ViewFields>
<Query>
    <Where>
        <DateRangesOverlap>
            <FieldRef Name='EventDate' />
            <FieldRef Name='EndDate' />
            <FieldRef Name='RecurrenceID' />
            <Value Type='DateTime'>
                <Year />
            </Value>
        </DateRangesOverlap>
    </Where>
    <OrderBy>
        <FieldRef Name='EventDate' />
    </OrderBy>
</Query>
<QueryOptions>
    <CalendarDate>2018-01-01T12:00:00Z</CalendarDate>
    <RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>
    <ExpandRecurrence>TRUE</ExpandRecurrence>
</QueryOptions>

1 Answer 1

3

Now and Year don't honour the CalendarDate property whereas others do honour it. See my article about it http://www.sharepointnadeem.com/2015/05/sharepoint-recurring-calendar-events.html

2
  • Have you noticed that CalendarDate is not honour it even for <Month /> in a DVWP? Aug 31, 2015 at 22:47
  • @IMTheNachoMan, I haven't checked that. Sep 1, 2015 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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