Hi Eric, On 5 October 2011 16:11, Eric Schwartz <[email protected]> wrote: > Thanks; that was exactly what I needed. In my Copious Free Time(tm), I would > be inclined to wrap that up into a method along these lines > > def TZInfo::Timezone#period_for_dst(year=Time.now.year) > # stuff > end > > if that's a patch you might be interested in. No worries if not; I can > understand wanting to keep such a widely-used library lean.
Yes, it seems like something along these lines would be useful, so I'd be interested in a patch if you can find the time. I think methods that returned an array of TimezonePeriod objects between two dates (one method for UTC and another for local time) would be more generally useful than just returning the periods in a year: def TZInfo::Timezone#periods_between_utc(utc_from, utc_to) # stuff end def TZInfo::Timezone#periods_between_local(local_from, local_to, dst = Timezone.default_dst) # stuff end The from and to parameters will have to accept Time, DateTime and Numeric parameters (see TZInfo::TimeOrDateTime). The local time version of the method will have to resolve ambiguous local times (see TZInfo::Timezone#period_for_local). Kind regards, Phil _______________________________________________ TZInfo-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/tzinfo-users
