Time undefined for a date-only timestamp

If the timestamp as the form "DD:MM::YYYY", the time is set to
"undefined" instead of "00:00:00".
This commit is contained in:
Jean-Sébastien Pédron 2011-05-26 15:40:49 +02:00
parent fb56071724
commit 24a56f503f

View File

@ -48,6 +48,8 @@ represent_token(#yaml_repr{simple_structs = true},
case string_to_timestamp(Text) of case string_to_timestamp(Text) of
{undefined, undefined, undefined, H, Mi, S, _, _} -> {undefined, undefined, undefined, H, Mi, S, _, _} ->
{finished, {undefined, {H, Mi, S}}}; {finished, {undefined, {H, Mi, S}}};
{Y, Mo, D, undefined, undefined, undefined, _, _} ->
{finished, {{Y, Mo, D}, undefined}};
{Y, Mo, D, H, Mi, S, _, _} -> {Y, Mo, D, H, Mi, S, _, _} ->
{finished, {{Y, Mo, D}, {H, Mi, S}}}; {finished, {{Y, Mo, D}, {H, Mi, S}}};
error -> error ->
@ -105,7 +107,8 @@ string_to_timestamp(Text) ->
list_to_integer(Y), list_to_integer(Y),
list_to_integer(Mo), list_to_integer(Mo),
list_to_integer(D), list_to_integer(D),
0, 0, 0, 0, 0 undefined, undefined, undefined,
0, 0
}; };
{match, [_, _, _, _, _, _, _, _, _, H, Mi, S]} -> {match, [_, _, _, _, _, _, _, _, _, H, Mi, S]} ->
%% Only a time. %% Only a time.