floraison / et-orbi

Time zones for fugit and rufus-scheduler. Urbi et Orbi.
MIT License
24 stars 11 forks source link

America/Santiago to DST kerfuffle #31

Closed jmettraux closed 3 years ago

jmettraux commented 3 years ago

https://github.com/floraison/fugit/issues/62

Weird: OP uses Active Support Time.zone = xxx but et-orbi doesn't seem to read Time.zone

jmettraux commented 3 years ago

2021-09-05 00:00:00 in America/Santiago is right on the transition to DST (https://www.timeanddate.com/time/zone/chile/santiago) hence TzInfo failing.

class ::TzINFO::TimeZone

  # ...

    def period_for_local(local_time, dst = Timezone.default_dst)
      raise ArgumentError, 'local_time must be specified' unless local_time
      local_time = Timestamp.for(local_time, :ignore)
      results = periods_for_local(local_time)

      if results.empty?
        raise PeriodNotFound, "#{local_time.strftime('%Y-%m-%d %H:%M:%S')} is an invalid local time." # <----
      elsif results.size < 2
        results.first
      else
        # ambiguous result try to resolve
jmettraux commented 3 years ago

Nothing to do with Active Support Time.zone. Back to fugit.