fixed #61, #62 refactored getTime variants
Some checks failed
Tests / Run Go Tests (push) Failing after 1m20s
Some checks failed
Tests / Run Go Tests (push) Failing after 1m20s
This commit is contained in:
@@ -16,6 +16,13 @@ func GetMonday(ts time.Time) time.Time {
|
||||
return ts
|
||||
}
|
||||
|
||||
func GetFirstOfMonth(ts time.Time) time.Time {
|
||||
if ts.Day() > 1 {
|
||||
return ts.AddDate(0, 0, -(ts.Day() - 1))
|
||||
}
|
||||
return ts
|
||||
}
|
||||
|
||||
func IsWeekend(ts time.Time) bool {
|
||||
return ts.Weekday() == time.Saturday || ts.Weekday() == time.Sunday
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user