From 156c84ff29a13f3d21c1b7ff271bda50797ca0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 26 Dec 2011 10:13:30 +0100 Subject: Use calendar date and time types exported since R14B04 Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types. --- src/cowboy_cookies.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/cowboy_cookies.erl') diff --git a/src/cowboy_cookies.erl b/src/cowboy_cookies.erl index 9c6c4c3..6818a86 100644 --- a/src/cowboy_cookies.erl +++ b/src/cowboy_cookies.erl @@ -23,7 +23,7 @@ -type kv() :: {Name::binary(), Value::binary()}. -type kvlist() :: [kv()]. -type cookie_option() :: {max_age, integer()} - | {local_time, {cowboy_clock:date(), cowboy_clock:time()}} + | {local_time, calendar:datetime()} | {domain, binary()} | {path, binary()} | {secure, true | false} | {http_only, true | false}. -export_type([kv/0, kvlist/0, cookie_option/0]). @@ -171,13 +171,12 @@ quote(V0) -> V end. --spec add_seconds(integer(), cowboy_clock:datetime()) - -> cowboy_clock:datetime(). +-spec add_seconds(integer(), calendar:datetime()) -> calendar:datetime(). add_seconds(Secs, LocalTime) -> Greg = calendar:datetime_to_gregorian_seconds(LocalTime), calendar:gregorian_seconds_to_datetime(Greg + Secs). --spec age_to_cookie_date(integer(), cowboy_clock:datetime()) -> binary(). +-spec age_to_cookie_date(integer(), calendar:datetime()) -> binary(). age_to_cookie_date(Age, LocalTime) -> cowboy_clock:rfc2109(add_seconds(Age, LocalTime)). -- cgit v1.2.3