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>