tarearbol v0.4.1 Tarearbol.Utils
Set of utilities used in Tarearbol
. It currently includes human-to-machine
interval conversions and options extractor.
Link to this section Summary
Functions
Converts a human representation of time interval to the one understandable by a computer. The conversion rules are
Link to this section Types
Link to this type
interval()
Link to this section Functions
Link to this function
add_interval(input, to \\ nil)
add_interval(Interval.t, DateTime.t | nil) :: DateTime.t
Adds an interval to the given DateTime
instance (or to
DateTime.utc_now
if none given, returning the DateTime
instance.
Link to this function
cron_to_time(at)
Converts a human representation of time interval to the one understandable by a computer. The conversion rules are:
integer
→ amount to be used as is (milliseconds fordelay
, number for attempts);float
→ amount of thousands, rounded (seconds fordelay
, thousands for attempts);:none
→0
;:tiny
→10
;:medium
→100
;:infinity
→-1
,:attempts
only.