scriptorium/utils/time

Types

pub type Time {
  Time(hours: Hour, minutes: Minute)
}

Constructors

  • Time(hours: Hour, minutes: Minute)

Functions

pub fn compare(a: Time, b: Time) -> Order

Compare if a is before (lower than) than b.

pub fn format(time: Time) -> String

Format a time to an hh:mm format string.

pub fn nil_time() -> Time

Get a time at hour 0 and minute 0.

pub fn parse(str: String) -> Result(Time, Nil)

Parse a time from an hh:mm format string.

Search Document