I assume you know that ambiguous times occur when you use a local time
which re-occurs due to change from DST.
So on November 6, 2011 in the US we will 'fall back' at 2:00 am. So
the local time goes from
01:59:59 01:00:00 .. 01:59:59, 02:00:00
so all of the seconds between 01:00:00 and 01:59:59 occur twice and
have TWO different UTC values.
Not entirely sure, but I think you found an edge-case bug in ri_cal.
In order to export VTIMEZONE blocks from tzinfo data, ri_cal finds the
first and last time mentioned for each tzid in the calendar, it then
exports a VTIMEZONE which has the required DST transitions to cover
that range.
I think that the problem is that you have one of those first or last
times for a tzid falls in the ambiguous period. And that the fix
would be to patch ri_cal so that it uses something like the beginning
of the month (or maybe year) for the first time, and the end of the
month or year for the last time, which should safely move it out of
the danger zone and still provide coverage of the times in the
calendar. I'll have a look at this when I get a chance.
You might want to try these patches to lib/ri_cal/component/tz_info_timezone.rb
replace the method at line 113 with:
# convert time from utc time to this time zone
def utc_to_local(time)
@tzinfo_timezone.utc_to_local(time.to_ri_cal_ruby_value)
end
convert the method at line 128 with:
def export_local_to(export_stream, local_start, local_end) #:nodoc:
export_utc_to(export_stream,
local_to_utc(local_start.to_ri_cal_ruby_value, true),
local_to_utc(local_end.to_ri_cal_ruby_value, false))
end
I haven't actually tried this, but in theory it should pick the DST
equivalent UTC (which is earlier) for the earlier time in the range
and the ST equivalent for the end,
if that makes sense.
> --
> You received this message because you are subscribed to the Google Groups "RiCal" group.
> To post to this group, send email to rica...@googlegroups.com.
> To unsubscribe from this group, send email to rical_gem+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rical_gem?hl=en.
>
>
--
Rick DeNatale
Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale