Reimplement the hacked version of Etc/UTC ignoring DST
This commit is contained in:
parent
bfafac0d48
commit
ef91711e12
1 changed files with 11 additions and 1 deletions
|
@ -34,12 +34,22 @@ build_index() ->
|
|||
|
||||
|
||||
build_function_clauses(List) ->
|
||||
Clauses = lists:map(fun({K, V}) ->
|
||||
Clauses = lists:map(fun({K0, V0}) ->
|
||||
{K, V} = hack_fix_utc({K0, V0}),
|
||||
io_lib:format("lookup(~p) -> ~p", [K, V])
|
||||
end, List),
|
||||
[lists:join(";\n", Clauses), ";\n",
|
||||
"lookup(_) -> error."].
|
||||
|
||||
|
||||
hack_fix_utc({"UTC", TZs}) ->
|
||||
MainTZ = "Etc/UTC",
|
||||
NoMainTZ = TZs -- [MainTZ],
|
||||
NewTZs = [MainTZ | NoMainTZ],
|
||||
{"UTC", NewTZs};
|
||||
hack_fix_utc({K, V}) ->
|
||||
{K, V}.
|
||||
|
||||
build_all_function(List) ->
|
||||
Keys = [K || {K, _} <- List],
|
||||
io_lib:format("all() -> ~p.",[Keys]).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue