ebeigarts/exchanger

TimeZone sets to UTC on all_day_events

dboze opened this issue · 4 comments

I am seeing this behavior when creating all_day_events as described here:

http://stackoverflow.com/questions/7828823/exchange-2010-web-services-creation-of-an-all-day-event-appointment

I am guessing this is because the Exchange server I am using is on Office365 (hosted Exchange) and therefore has a default server time of UTC.

Would adding StartTimeZone and EndTimeZone to CalendarItem as well as creating an Entry of TimeZone with and :id and :name (as described here http://msdn.microsoft.com/en-us/library/exchange/ff406132(v=exchg.140).aspx) be the best way to go?

Thanks!

This feature is not implemented in exchanger, but looks like StartTimeZone and EndTimeZone is the way to go.

Maybe exchanger could in future set this automatically using tzinfo gem.

Thanks for pointing me in the right direction! So I got exchanger to send the request I wanted and received

The request is valid but does not specify the correct server version in the RequestServerVersion SOAP header. Ensure that the RequestServerVersion SOAP header is set with the correct RequestServerVersionValue.

So I added to CreateItem

xml.send("soap:Header") do
  xml.send("t:RequestServerVersion", "Version" => "Exchange2010")
end

(Naturally, I will clean it up so the Version can be specified in the config YAML) In turn, I was given:

The EWS Id is in EwsLegacyId format which is not supported by the Exchange version specified by your request. Please use the ConvertId method to convert from EwsLegacyId to EwsId format.

So I've attempted to add to the body of the request

xml.send("ConvertId", "xmlns" => NS["m"], "xmlns:t" => NS["t"], "DestinationFormat" => "OwaId") do
  xml.send("SourceIds") do
    xml.send("t:AlternateId", "Format" => "EwsLegacyId", "Id" => "", "Mailbox" => "foo@bar.com")
  end
end

But I am at a loss as to how to ascertain the Id for a given mailbox. Any thoughts?

Thanks again for the help!

Edit: Oh, I see! I can get the Id from the find response, duh! I'm not quite sure how to clean all of this up, but I'll make an attempt and send it your way. Will this functionality need to be added to all of the operations? I don't need them all myself, but I want to give a little back to this great gem.

I just updated specs and run them against Office 365 and all the existing specs are running fine there.

It would be great to have RequestServerVersion configurable and support for meetings :)

Was this ever implemented? I'm having issues where the calendar items are showing the correct time on the calendar, but when you edit, it's showing in UTC like "(UTC+00:00) Monrovia, Reykjavik". Anything I send on the CalendarItem itself doesn't seem to affect it.