Skip to content

Commit

Permalink
Merge pull request #60 from ecederstrand/patch-1
Browse files Browse the repository at this point in the history
Backport upstream commit e2b4360
  • Loading branch information
dominicj-nylas authored Jan 29, 2021
2 parents 3c9ac92 + d65dbb8 commit a7d61e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion exchangelib/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,12 @@ def _get_std_and_dst(transitiongroup, periods, bias):
for transition in transitiongroup:
period = periods[transition['to']]
if len(transition.keys()) == 1:
# This is a simple transition to STD time. That cannot be represented by this class
# This is a simple transition representing a timezone with no DST. Some servers don't accept TimeZone
# elements without a STD and DST element (see issue #488). Return StandardTime and DaylightTime objects
# with dummy values and 0 bias - this satisfies the broken servers and hopefully doesn't break the
# well-behaving servers.
standard_time = StandardTime(bias=0, time=datetime.time(0), occurrence=1, iso_month=1, weekday=1)
daylight_time = DaylightTime(bias=0, time=datetime.time(0), occurrence=5, iso_month=12, weekday=7)
continue
# 'offset' is the time of day to transition, as timedelta since midnight. Must be a reasonable value
if not datetime.timedelta(0) <= transition['offset'] < datetime.timedelta(days=1):
Expand Down

0 comments on commit a7d61e0

Please sign in to comment.