···
Printf.sprintf "%s %s%s" (format_date ?tz date) (format_time ?tz date) tz_str
let y1, m1, d1 = Ptime.to_date day in
let y2, m2, d2 = Ptime.to_date next in
···
-
match (is_date event, next_day start ~next:end_) with
-
| true, true -> ("", "")
-
| true, _ -> (" - " ^ format_date ?tz end_, "")
-
| false, true -> ("", " - " ^ format_time ?tz end_)
-
(" - " ^ format_date ?tz end_, " " ^ format_time ?tz end_))
match get_summary event with
···
Printf.sprintf "%s %s%s" (format_date ?tz date) (format_time ?tz date) tz_str
+
let same_day day other =
+
let y1, m1, d1 = Ptime.to_date day in
+
let y2, m2, d2 = Ptime.to_date other in
+
y1 == y2 && m1 == m2 && d1 == d2
let y1, m1, d1 = Ptime.to_date day in
let y2, m2, d2 = Ptime.to_date next in
···
+
match is_date event with
+
match next_day start ~next:end_ with
+
| false -> (" - " ^ format_date ?tz end_, ""))
+
match same_day start end_ with
+
| true -> ("", " - " ^ format_time ?tz end_)
+
(" - " ^ format_date ?tz end_, " " ^ format_time ?tz end_)))
match get_summary event with