From 31e123d9f1d67cc4a6b9070ba8bf318ec7fd98d0 Mon Sep 17 00:00:00 2001 From: Pavel Abalikhin Date: Wed, 22 Nov 2017 12:33:15 +0300 Subject: [PATCH] Rename floor/1 to flooring/1 Fix for Erlang/OTP 20 --- src/qdate.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qdate.erl b/src/qdate.erl index 5a5bd03..8ef62c0 100644 --- a/src/qdate.erl +++ b/src/qdate.erl @@ -1070,7 +1070,7 @@ deregister_format(Key) -> unixtime_to_now(T) when is_integer(T) -> - MegaSec = floor(T/1000000), + MegaSec = flooring(T/1000000), Secs = T - MegaSec*1000000, {MegaSec,Secs,0}. @@ -1078,10 +1078,10 @@ unixtime_to_date(T) -> Now = unixtime_to_now(T), calendar:now_to_datetime(Now). -floor(N) when N >= 0 -> - trunc(N); -floor(N) when N < 0 -> - Int = trunc(N), +flooring(N) when N >= 0 -> + erlang:trunc(N); +flooring(N) when N < 0 -> + Int = erlang:trunc(N), if Int==N -> Int; true -> Int-1 @@ -1323,7 +1323,7 @@ compressed_parser(_) -> microsoft_parser(FloatDate) when is_float(FloatDate) -> try - DaysSince1900 = floor(FloatDate), + DaysSince1900 = flooring(FloatDate), Days0to1900 = calendar:date_to_gregorian_days(1900,1,1), GregorianDays = Days0to1900 + DaysSince1900, Date = calendar:gregorian_days_to_date(GregorianDays),