birl/duration

Types

pub type Duration {
  Duration(Int)
}

Constructors

  • Duration(Int)
pub type Unit {
  MilliSecond
  Second
  Minute
  Hour
  Day
  Week
  Month
  Year
}

Constructors

  • MilliSecond
  • Second
  • Minute
  • Hour
  • Day
  • Week
  • Month
  • Year

Functions

pub fn accurate_decompose(duration: Duration) -> List(
  #(Int, Unit),
)

Use this if you need very long durations where small inaccuracies could lead to large errors

pub fn accurate_new(values: List(#(Int, Unit))) -> Duration

Use this if you need very long durations where small inaccuracies could lead to large errors

pub fn decompose(duration: Duration) -> List(#(Int, Unit))

Use this if you need short durations where a year just means 365 days and a month just means 30 days

pub fn new(values: List(#(Int, Unit))) -> Duration

Use this if you need short durations where a year just means 365 days and a month just means 30 days

Search Document