1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 15:12:26 +08:00

新增判断是否是周末的方法 (#105)

* 新增判断是否是周末的方法

* 新增判断是否是周末的方法

---------

Co-authored-by: huangxingming <huangxingming@kezaihui.com>
This commit is contained in:
hhhhhxm
2023-05-31 17:05:20 +08:00
committed by GitHub
parent 09ec5b97a6
commit 69b32fd043
2 changed files with 20 additions and 0 deletions

View File

@@ -247,3 +247,7 @@ func DayOfYear(t time.Time) int {
return int(nowDate.Sub(firstDay).Hours() / 24)
}
func IsWeekend(t1 time.Time) bool {
return time.Saturday == t1.Weekday() || time.Sunday == t1.Weekday()
}