Repeat occurrences hitting DST changes

30 views
Skip to first unread message

Kurt Werle

unread,
Jun 13, 2011, 7:43:51 PM6/13/11
to RiCal
We have also hit the issue of ambiguous times when hitting DST
changes. In particular, if our users set up an even that happens at
an OK time (1:30am) then repeat daily or weekly, etc - in such a way
as it intersects an ambiguous time, we end up with:

/Library/Ruby/Gems/1.8/gems/tzinfo-0.3.14/lib/tzinfo/timezone.rb:
363:in `period_for_local'
/Library/Ruby/Gems/1.8/gems/tzinfo-0.3.14/lib/tzinfo/timezone.rb:
417:in `local_to_utc'
/Library/Ruby/Gems/1.8/gems/tzinfo-0.3.14/lib/tzinfo/
time_or_datetime.rb:276:in `wrap'
/Library/Ruby/Gems/1.8/gems/tzinfo-0.3.14/lib/tzinfo/timezone.rb:
413:in `local_to_utc'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/component/
calendar.rb:132:in `local_to_utc'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/
date_time/timezone_support.rb:53:in `utc'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/
date_time.rb:302:in `ruby_value'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/properties/
event.rb:134:in `dtstart'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/
occurrence_enumerator.rb:122:in `options_stop'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/
occurrence_enumerator.rb:140:in `each'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/
occurrence_enumerator.rb:173:in `to_a'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/
occurrence_enumerator.rb:173:in `to_a'
/Library/Ruby/Gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/
occurrence_enumerator.rb:193:in `occurrences'
<our code...>

There is no way for us to specify DST true/false at that point.

I would like to see a global option for DST true/false to work around
this problem. If unset, then you get the current behavior. If set,
then it just uses that value (unless an overriding value is passed
in).

I'd be happy to contribute a patch, but I am also getting

Aeolus:/Users/kwerle/Source/ri_cal% rake spec
(in /Users/kwerle/Source/ri_cal)
rake aborted!
no such file to load -- lib/ad_agency/print_shop
/Users/kwerle/Source/ri_cal/Rakefile:6
(See full trace by running task with --trace)

Dunno which [versions of which] gems you're using.

Kurt Werle

unread,
Jun 29, 2011, 11:54:06 AM6/29/11
to RiCal
tzinfo has been patched in version 0.3.29 so that you can set a
default position so as to avoid ambiguous times.
http://rubyforge.org/forum/forum.php?forum_id=39368

--
ku...@CircleW.org
http://www.CircleW.org/kurt/

Reply all
Reply to author
Forward
0 new messages