type error = [
| `Does_not_exist
| `Invalid_year of int
| `Invalid_month of int
]
exception Error_exn of error
Constructors
val make : year:int -> month:int -> (t, error) Stdlib.result
val make_exn : year:int -> month:int -> t
Accessors
val year_month : t -> int * int
Comparison
val equal : t -> t -> bool
val compare : t -> t -> int
Arithmetic
val add : ?years:int -> ?months:int -> t -> t
val sub : ?years:int -> ?months:int -> t -> t
val diff_months : 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