Skip to content

Commit

Permalink
Added am/pm to format string
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Apr 12, 2024
1 parent 08da22c commit 0f61638
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions timedesc/printers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f61638

Please sign in to comment.