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, context: Context) -> String

Format a time to a string.

pub fn format_iso(time: Time) -> String

Format a time to an hh:mm 24 hour 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