Skip to content

Commit ea483a9

Browse files
committed
Fix Time.timeToString() not showing leading 0 in minute on clock
1 parent e5834f6 commit ea483a9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/utils/Time.re

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ open Unix
22

33
let timeToString = (time) => {
44
let rawMinutes = string_of_int(time.tm_min);
5-
let minutes = if (String.length(rawMinutes) == 1) {
6-
"0"
7-
} else {
8-
""
9-
} ++ rawMinutes;
105

11-
minutes
6+
rawMinutes
7+
|> String.cat(if (String.length(rawMinutes) == 1) { "0" } else { "" })
128
|> String.cat(":")
139
|> String.cat(string_of_int(time.tm_hour))
1410
|> String.cat(" ");

0 commit comments

Comments
 (0)