Issue #7: Some Zones no longer observing DST are broen. The matchspec generation function for universal time was wrong, whereas it was fine for wall and local times. Fixing that line, and considering the `current` flatzone time, was enough to get TZs like Tokyo and Jamaica working correctly in tested cases.
This commit is contained in:
@@ -30,13 +30,6 @@ parse([Name,GmtOffS,Rule,FormatS | UntilTokens]) ->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
current(TzName) ->
|
||||
current_as_of_utc(erlang:universaltime(), TzName).
|
||||
|
||||
@@ -101,10 +94,10 @@ project_end_utc(Zone=#zone{}, DSTOffset) ->
|
||||
%% though it's very unlikely (and does not exist in the current tz database files).
|
||||
%% this method covers that event, anyhow. see unit tests for examples.
|
||||
next(ZoneList, UTCFrom, DSTOff) ->
|
||||
?debugMsg("next:"),
|
||||
?debugVal(ZoneList),
|
||||
?debugVal(UTCFrom),
|
||||
|
||||
%% ?debugMsg("next:"),
|
||||
%% ?debugVal(ZoneList),
|
||||
%% ?debugVal(UTCFrom),
|
||||
|
||||
DatedList= lists:map(
|
||||
fun(Z=#zone{until=Until, gmtoff=Offset})->
|
||||
NUntil= ezic_date:normalize(Until),
|
||||
@@ -113,7 +106,5 @@ next(ZoneList, UTCFrom, DSTOff) ->
|
||||
end
|
||||
, ZoneList),
|
||||
FilteredList= lists:filter(fun({IDt,_})-> ezic_date:compare(UTCFrom, IDt) end, DatedList),
|
||||
|
||||
%x ?debugVal(FilteredList),
|
||||
SortedList= lists:sort(fun({X,_},{Y,_})->ezic_date:compare(X,Y)end, FilteredList),
|
||||
[Z || {_,Z}<- SortedList].
|
||||
|
||||
Reference in New Issue
Block a user