ebeigarts / exchanger

Ruby client for Exchange Web Services
MIT License
57 stars 36 forks source link

Fix DST change dates #13

Closed danielfarrell closed 10 years ago

danielfarrell commented 10 years ago

These changed in 2007.

ebeigarts commented 10 years ago

I'm not sure if this is the correct way to fix this, the dates are timezone specific, we can get this information using timezone:

time_zone = TZInfo::Timezone.get("Europe/London").current_period
time_zone.start_transition.at.month #=> 10
time_zone.start_transition.at.day #=> 26
time_zone.start_transition.at.to_time.strftime("%A") #=> Sunday
time_zone.start_transition.at.to_time.strftime("%H:%M") #=> "01:00"
time_zone.end_transition....
danielfarrell commented 10 years ago

That is probably a better long term fix, I agree. Just thought I would share this in case other people got bit by it this week.

ebeigarts commented 10 years ago

Thanks, for bringing this up.

danielfarrell commented 10 years ago

It should be noted this this does not work at all when not in DST anymore. The API complains about missing StandardTime and DaylightTime blocks. In my working branch I've just removed the .dst? query to make it work.