use Date#wday to reduce branching