code: func (s *Schedule) mostRecentStart(now time.Time) (time.Time, error) {
  	t, err := s.GetStart().toTime()
  	if err != nil {
  		return time.Time{}, err
  	}
  	now = now.In(t.Location())
  	// toTime returns a time relative to the current date. Change it to be relative to the given date.
  	t = time.Date(now.Year(), now.Month(), now.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), t.Location())
  	if s.GetStart().Day == dayofweek.DayOfWeek_DAY_OF_WEEK_UNSPECIFIED {
  		return time.Time{}, errors.Reason("day must be specified").Err()
  	}
  	for !isSameDay(t.Weekday(), s.GetStart().Day) {
  		t = t.Add(time.Hour * -24)
  	}
  	if t.After(now) {
  		t = t.Add(time.Hour * -24 * 7)
  	}
  	return t, nil
  }
docs: // mostRecentStart returns the most recent start time for this schedule relative
  // to the given time. The date in the returned time.Time will be the most recent
  // date falling on the day of the week specified in this schedule which results
  // in the returned time being equal to or before the given time.