all builders now take duration strings

This commit is contained in:
Sam Lewis
2022-10-16 22:45:13 -04:00
parent 6ca78e88dd
commit 145c12dd25
5 changed files with 31 additions and 40 deletions

View File

@@ -14,8 +14,8 @@ func GetId() int64 {
return id
}
func ParseTime[T ~string](s T) carbon.Carbon {
t, err := time.Parse("15:04", string(s))
func ParseTime(s string) carbon.Carbon {
t, err := time.Parse("15:04", s)
if err != nil {
log.Fatalf("Failed to parse time string \"%s\"; format must be HH:MM.", s)
}