Ad
Code
Diff
  • package kumite
    
    import "time"
    
    func CheckWorkHours(dateTime time.Time) bool {
      weekday := dateTime.Weekday() 
      hour := dateTime.Hour()
      
      if weekday == time.Thursday || weekday == time.Sunday {
        return false
      }
      
      return hour >= 8 && hour < 18
    }
    
    • package kumite
    • import "time"
    • func CheckWorkHours(dateTime time.Time) bool {
    • return true &&
    • dateTime.Weekday() != time.Thursday &&
    • dateTime.Weekday() != time.Sunday &&
    • dateTime.Hour() >= 8 &&
    • dateTime.Hour() < 18
    • weekday := dateTime.Weekday()
    • hour := dateTime.Hour()
    • if weekday == time.Thursday || weekday == time.Sunday {
    • return false
    • }
    • return hour >= 8 && hour < 18
    • }