code: func calcWeekday(daynr int, sundayFirstDayOfWeek bool) int {
  	daynr += 5
  	if sundayFirstDayOfWeek {
  		daynr++
  	}
  	return daynr % 7
  }
docs: // calcWeekday calculates weekday from daynr, returns 0 for Monday, 1 for Tuesday ...