1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

feat: add IsWeekend

This commit is contained in:
dudaodong
2023-05-31 17:13:06 +08:00
parent a415597c6b
commit 10e3732f32
4 changed files with 106 additions and 2 deletions

View File

@@ -248,6 +248,8 @@ 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()
// IsWeekend checks if passed time is weekend or not.
// Play: todo
func IsWeekend(t time.Time) bool {
return time.Saturday == t.Weekday() || time.Sunday == t.Weekday()
}