Skip to content

Commit

Permalink
Add a method to find items using a calendar view (#276)
Browse files Browse the repository at this point in the history
The calendar view will not only list the single calendar items between the
start and end date but also occurences of recurring calendar items.
See also: https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/calendarview

This method was original already present in Viewpoint < 1.0.
  • Loading branch information
paulvt authored Jul 8, 2024
1 parent fb8edab commit 69cbf57
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/ews/types/calendar_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ def items_between(start_date, end_date, opts={})
end
end

# Fetch items between a given time period using a calendar view.
# The calendar view will include occurences of recurring calendar items
# next to the regular single calendar items.
# @param [DateTime] start_date the time to start fetching Items from
# @param [DateTime] end_date the time to stop fetching Items from
# @param opts [Hash]
# @option opts :max_entries_returned [Integer] the maximum number of entries to return
def items_between_calendar_view(start_date, end_date, opts={})
view_opts = {:start_date => start_date, :end_date => end_date}
view_opts[:max_entries_returned] = opts.delete(:max_entries_returned) if opts[:max_entries_returned]
items(opts.merge(:calendar_view => view_opts))
end

# Creates a new appointment
# @param attributes [Hash] Parameters of the calendar item. Some example attributes are listed below.
# @option attributes :subject [String]
Expand Down

0 comments on commit 69cbf57

Please sign in to comment.