package kumite import "time" func CheckWorkHours(dateTime time.Time) bool { return 1 <= dateTime.Weekday() && dateTime.Weekday() <= 5 && 8 <= dateTime.Hour() && dateTime.Hour() < 18 }
- package kumite
- import "time"
- func CheckWorkHours(dateTime time.Time) bool {
const (firstWorkingDay = 1lastWorkingDay = 5firstWorkingHour = 8lastWorkingHour = 18)day, hour := dateTime.Weekday(), dateTime.Hour()return firstWorkingDay <= day && day <= lastWorkingDay && firstWorkingHour <= hour && hour < lastWorkingHour- return 1 <= dateTime.Weekday() && dateTime.Weekday() <= 5 && 8 <= dateTime.Hour() && dateTime.Hour() < 18
- }