MoreTime

MoreTime contains some helpful functions for operating on DateTime-like maps. These are useful for rounding and bucketing times in a stable way.

Like the standard library, it operates on maps that have the set of keys that are used by DateTime. Any other map/struct that has the same keys should work with these functions.

Included Functions

Generalized time bucketing function:

Calendar-based bucketing functions:

Installation

The package can be installed by adding more_time to your list of dependencies in mix.exs:

def deps do
  [
    {:more_time, "~> 0.1.0"}
  ]
end