diff --git a/styles.go b/styles.go index a701a69e4f..d16f28a4e3 100644 --- a/styles.go +++ b/styles.go @@ -1016,13 +1016,13 @@ func parseTime(v string, format string) string { goFmt = strings.Replace(goFmt, "H", "3", 1) } else { goFmt = strings.Replace(goFmt, "hh", "15", 1) - if val.Hour() < 12 { + if 0 < val.Hour() && val.Hour() < 12 { goFmt = strings.Replace(goFmt, "h", "3", 1) } else { goFmt = strings.Replace(goFmt, "h", "15", 1) } goFmt = strings.Replace(goFmt, "HH", "15", 1) - if val.Hour() < 12 { + if 0 < val.Hour() && val.Hour() < 12 { goFmt = strings.Replace(goFmt, "H", "3", 1) } else { goFmt = strings.Replace(goFmt, "H", "15", 1)