assume all datetimes are UTC time and add timezone designator to

generated iso8601 strings
This commit is contained in:
alisdair sullivan 2015-03-03 10:43:04 -08:00
parent 2824e56d44
commit 84f4b7fb40
3 changed files with 6 additions and 4 deletions

View file

@ -54,6 +54,9 @@ encode(Term, EntryPoint) -> encode_(Term, EntryPoint).
encode_([], _EntryPoint) -> [start_array, end_array];
encode_([{}], _EntryPoint) -> [start_object, end_object];
%% datetime special case
encode_([{{_,_,_},{_,_,_}} = DateTime|Rest], EntryPoint) ->
[start_array] ++ [DateTime] ++ unhitch(Rest, EntryPoint);
encode_([{_, _}|_] = Term, EntryPoint) ->
[start_object] ++ unzip(Term, EntryPoint);
encode_(Term, EntryPoint) when is_list(Term) ->