code: public static DayOfWeek dayOfWeek(DateValue date) {
  		int dayIndex = fixedFromGregorian(date.year(), date.month(), date.day()) % 7;
  		if (dayIndex < 0) {
  			dayIndex += 7;
  		}
  		return DAYS_OF_WEEK[dayIndex];
  	}
docs: Gets the day of the week the given date falls on.
  @param date the date
  @return the day of the week