现在StartTime需要是周一

This commit is contained in:
2025-04-27 16:01:59 +08:00
parent 43d0a1ebe0
commit c9cba24134
2 changed files with 8 additions and 3 deletions

View File

@@ -2,9 +2,10 @@ package config
import (
"fmt"
"os"
"github.com/golang-module/carbon/v2"
"github.com/spf13/viper"
"os"
)
func Load() {
@@ -26,7 +27,7 @@ func Load() {
carbon.SetDefault(carbon.Default{
Layout: carbon.DateTimeLayout,
Timezone: carbon.PRC,
WeekStartsAt: carbon.Sunday,
WeekStartsAt: carbon.Monday,
Locale: "zh-CN", // 取值范围lang 目录下翻译文件名,不包含文件后缀
})
@@ -39,6 +40,10 @@ func check() {
os.Exit(1)
}
if startTime := carbon.Parse(StartTime); startTime.IsMonday() != true {
fmt.Println("the start time must be a monday")
os.Exit(1)
}
}
func debugprint() {