aboutsummaryrefslogtreecommitdiff
path: root/lib/kernel/date_spec.mli
blob: 600f1eb94c48dbfcc0e9b6860f6f76f599b608d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
(** A sanctoral entry's date expression. *)
type t = Fixed of { month : int; day : int } [@@deriving sexp]

val sexp_of_t : t -> Sexplib0.Sexp.t
val t_of_sexp : Sexplib0.Sexp.t -> t

(** Validates against the leap-year maximum, so 29 February is constructible. *)
val fixed : month:int -> day:int -> (t, string) result

(** [None] when the spec does not occur in that year (29 February in a common
    year) or falls outside the supported domain. *)
val resolve : t -> year:int -> Date.t option