aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-13 00:06:00 +0900
committernsfisis <nsfisis@gmail.com>2023-03-13 00:06:14 +0900
commitc32f49625c3be59bb10d4d471446580a19557250 (patch)
treef275d82f5b6e6c378716c20c038fdec5d41afc6a
parent367dc1ea5ce1548d01688fda6baa5c9861f964e1 (diff)
downloadterm-clock-c32f49625c3be59bb10d4d471446580a19557250.tar.gz
term-clock-c32f49625c3be59bb10d4d471446580a19557250.tar.zst
term-clock-c32f49625c3be59bb10d4d471446580a19557250.zip
fix(timer) fix a crash when duration is longer than 1 hour
-rw-r--r--cmd/timer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/timer.go b/cmd/timer.go
index aca2380..5288fe1 100644
--- a/cmd/timer.go
+++ b/cmd/timer.go
@@ -1,6 +1,7 @@
package cmd
import (
+ "fmt"
"log"
"time"
@@ -41,6 +42,11 @@ func cmdTimer(cmd *cobra.Command, args []string) {
log.Fatalf("%+v", err)
}
+ if timerTime.Minutes() > 60 {
+ fmt.Println("Duration over 1 hour is not supported.")
+ return
+ }
+
scr, err := term.NewScreen()
if err != nil {
log.Fatalf("%+v", err)