From 0f61638f94afd969caddf9546034e523bec3c8a1 Mon Sep 17 00:00:00 2001 From: Darren Li Date: Fri, 12 Apr 2024 17:04:47 +1000 Subject: [PATCH] Added am/pm to format string --- timedesc/printers.ml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/timedesc/printers.ml b/timedesc/printers.ml index f43082f3..9c1f358f 100644 --- a/timedesc/printers.ml +++ b/timedesc/printers.ml @@ -149,6 +149,18 @@ module Format_string_parsers = struct else if hour > 12 then hour - 12 else hour in return (pad_int padding hour)); + (string "am/pm:" + *> commit + *> case + >>= fun case1 -> + case + >>= fun case2 -> + let c1, c2 = + if hour < 12 then ('a', 'm') + else ('p', 'm') + in + return (Printf.sprintf "%c%c" + (map_char_to_case case1 c1) (map_char_to_case case2 c2))); (string "min:" *> commit *> padding