package timedesc

  1. Overview
  2. Docs
type t
type error = [
  1. | `Does_not_exist
  2. | `Invalid_iso_year of int
  3. | `Invalid_iso_week of int
]

Constructors

val make : year:int -> week:int -> (t, error) Stdlib.result
val make_exn : year:int -> week:int -> t

Accessors

val year_week : t -> int * int
val year : t -> int
val week : t -> int

Comparison

val equal : t -> t -> bool
val lt : t -> t -> bool
val le : t -> t -> bool
val gt : t -> t -> bool
val ge : t -> t -> bool
val compare : t -> t -> int

Arithmetic

val add : weeks:int -> t -> t
val sub : weeks:int -> t -> t
val diff_weeks : t -> t -> int

Pretty printing

val pp_iso8601 : Stdlib.Format.formatter -> t -> unit
val to_iso8601 : t -> string

Parsing

val of_iso8601 : string -> (t, string) Stdlib.result
val of_iso8601_exn : string -> t