Skip to content

Commit 933588a

Browse files
committed
Partial fix for #473
Today we do not have support in Timex for ambiguous date/times with more than two selections, but we have discovered at least one instance where more than two exist. This fix produces usable results, albeit without providing a full selection of the available periods for the time and zone.
1 parent 6887e40 commit 933588a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/timezone/timezone.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ defmodule Timex.Timezone do
316316
[period] ->
317317
tzdata_to_timezone(period, name)
318318
# Ambiguous
319-
[before_period, after_period] ->
319+
# TODO:
320+
# The pattern here was added because there are apparently some
321+
# cases in which more than two periods are known for a given point in time,
322+
# case in point ~N[2011-08-11T13:30:31] in Asia/Gaza. We do not have support
323+
# at this time for more than two alternates, but this will need to be dealt with
324+
[before_period, after_period | _others] ->
320325
before_tz = tzdata_to_timezone(before_period, name)
321326
after_tz = tzdata_to_timezone(after_period, name)
322327
AmbiguousTimezoneInfo.new(before_tz, after_tz)

0 commit comments

Comments
 (0)