added helper function, and fixed #28
All checks were successful
Tests / Run Go Tests (push) Successful in 29s
All checks were successful
Tests / Run Go Tests (push) Successful in 29s
This commit is contained in:
@@ -20,6 +20,11 @@ func IsWeekend(ts time.Time) bool {
|
|||||||
return ts.Weekday() == time.Saturday || ts.Weekday() == time.Sunday
|
return ts.Weekday() == time.Saturday || ts.Weekday() == time.Sunday
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetKW(t time.Time) int {
|
||||||
|
_, kw := t.ISOWeek()
|
||||||
|
return kw
|
||||||
|
}
|
||||||
|
|
||||||
// Converts duration to string
|
// Converts duration to string
|
||||||
func FormatDuration(d time.Duration) string {
|
func FormatDuration(d time.Duration) string {
|
||||||
hours := int(d.Abs().Hours())
|
hours := int(d.Abs().Hours())
|
||||||
|
|||||||
Reference in New Issue
Block a user