Time Zone support broken with TZInfo 2.0.0
ticky opened this issue · comments
TZInfo 2.0.0 was released in December, and icalendar’s monkey-patching doesn’t work due to some internal changes.
If a time zone has any timezone transitions, icalendar’s extensions break:
TZInfo::Timezone.get('Etc/UTC').ical_timezone(DateTime.now)
Traceback (most recent call last):
8: from /app/bin/irb:18:in `<main>'
7: from (irb):7
6: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:101:in `ical_timezone'
5: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:151:in `standard'
4: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:169:in `build_timezone'
3: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:169:in `tap'
2: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:173:in `block in build_timezone'
1: from /app/vendor/bundle/ruby/2.5.0/gems/icalendar-2.5.2/lib/icalendar/tzinfo.rb:79:in `dtstart'
NameError (undefined local variable or method `local_start' for #<TZInfo::TimezoneTransition:0x00000000033b7290>
Did you mean? local_start_at)
Looks like that change is documented in version 2.0 of tzinfo's release notes:
The
datetime
,time
,local_end
,local_end_time
,local_start
andlocal_start_time
instance methods ofTZInfo::TimezoneTransition
have been removed. Theat
,local_end_at
andlocal_start_at
methods should be used instead and the result (aTZInfo::TimestampWithOffset
) converted to either aDateTime
orTime
by callingto_datetime
orto_time
on the result.
I believe this is fixed by #204.
This should be fixed now. Releasing a new gem soon