jasonjoh / ruby_outlook

A gem wrapper around the Mail, Calendar, and Contacts APIs.
Other
68 stars 38 forks source link

Update get_calendar_view to get more details #8

Closed chaingng closed 6 years ago

chaingng commented 7 years ago

I'd like to get calendars more precisely with get_calendars_view by using hours, minutes and seconds parameters.

For example, currently,

>calendars = @client.get_calendar_view(@access_token, DateTime.parse('2017-07-15T00:00:00'), DateTime.parse('2017-07-15T05:00:00'))
> calendars['value'].map{|c| [c['Start']['DateTime'], c['End']['DateTime']]}
=> [["2017-07-15T00:00:00.0000000", "2017-07-15T01:00:00.0000000"]]

I'd like to do that.

>calendars = @client.get_calendar_view(@access_token, DateTime.parse('2017-07-15T00:00:00'), DateTime.parse('2017-07-15T05:00:00'))
> calendars['value'].map{|c| [c['Start']['DateTime'], c['End']['DateTime']]}
=> [["2017-07-15T00:00:00.0000000", "2017-07-15T01:00:00.0000000"],
 ["2017-07-15T02:00:00.0000000", "2017-07-15T06:00:00.0000000"]]

Please review it.