ebeigarts/exchanger

Incorrect UTC support

Opened this issue · 1 comments

When I'm using the CalendarItem, EWS is returning CalendarEvents like this:

          <CalendarEvent>
            <StartTime>2013-08-26T06:43:53</StartTime>
            <EndTime>2013-08-26T06:53:53</EndTime>
            <BusyType>Busy</BusyType>
          </CalendarEvent>

The exchanger library is calling Time.xmlschema on these times.
The problem is that they are not in the correct xmlschema format. These times are UTC. But the xmlschema specification is clear, for UTC times you need to add a Z at the end of it.

See:

2.0.0-p247 :003 > Time.xmlschema '2013-08-26T06:43:53'
=> 2013-08-26 06:43:53 +0900 
2.0.0-p247 :004 > Time.xmlschema '2013-08-26T06:43:53Z'
 => 2013-08-26 06:43:53 UTC 

The first one is converted to my local timezone. The second one is correct.
So basically, if you book meetings in UTC, you'll have a bad time when you get them back.
Am I wrong?

I haven't implemented any kind of typecasting, there are # TODO: Add typecasting in attributes.rb, pull requests are welcome :)