aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_cookies.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-12-26 10:13:30 +0100
committerLoïc Hoguin <[email protected]>2011-12-26 10:17:29 +0100
commit156c84ff29a13f3d21c1b7ff271bda50797ca0ef (patch)
treeaa22d1276732949741e67c04774f1382b660d26c /src/cowboy_cookies.erl
parent52c177fa6feedeed6a5fe565f13bf49cd61ef64e (diff)
downloadcowboy-156c84ff29a13f3d21c1b7ff271bda50797ca0ef.tar.gz
cowboy-156c84ff29a13f3d21c1b7ff271bda50797ca0ef.tar.bz2
cowboy-156c84ff29a13f3d21c1b7ff271bda50797ca0ef.zip
Use calendar date and time types exported since R14B04
Removes the cowboy_clock:date/0, time/0 and datetime/0 exported types.
Diffstat (limited to 'src/cowboy_cookies.erl')
-rw-r--r--src/cowboy_cookies.erl7
1 files changed, 3 insertions, 4 deletions
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)).