@param $weekDay - string see self::WEEK_

@return string see self::WEEK_
512809
public function getWeekDayNext($weekDay)
    {
        switch (strtolower($weekDay)) {
            case self::WEEK_SUNDAY:
                $result = self::WEEK_MONDAY;
                break;
            case self::WEEK_MONDAY:
                $result = self::WEEK_TUESDAY;
                break;
            case self::WEEK_TUESDAY:
                $result = self::WEEK_WEDNESDAY;
                break;
            case self::WEEK_WEDNESDAY:
                $result = self::WEEK_THURSDAY;
                break;
            case self::WEEK_THURSDAY:
                $result = self::WEEK_FRIDAY;
                break;
            case self::WEEK_FRIDAY:
                $result = self::WEEK_SATURDAY;
                break;
            case self::WEEK_SATURDAY:
                $result = self::WEEK_SUNDAY;
                break;
        }
        return $result;
    }
18636
private function getDayBefore($dayNumber)
    {
        $tmpDayNumber = $dayNumber;

        for ($i = 0; $i < 6; $i++) {
            $tmpDayNumber = (Days::MONDAY === $tmpDayNumber) ? Days::SUNDAY : --$tmpDayNumber;

            if (null !== $day = $this->getDay($tmpDayNumber)) {
                return $day;
            }
        }

        return $this->getDay($dayNumber);
    }
825082
private static Weekmodel getDefaultWeekmodel() {

        return Weekmodel.of(Weekday.SATURDAY, 1, Weekday.SATURDAY, Weekday.SUNDAY);

    }
1290681
public function plusWeeks(int $weeks) : ZonedDateTime
    {
        return ZonedDateTime::of($this->localDateTime->plusWeeks($weeks), $this->timeZone);
    }
1286972
function() {
			var html = ''
	
			for(i = 0, x = this.weekdays.length; i < x; i++) {
				html += '<th>' + this.weekdays[i].substring(0, 2) + '</th>'
			}
			return html
		}
989389
public function weekday($value = null)
    {
        $dayOfWeek = ($this->dayOfWeek + 7 - intval($this->getTranslationMessage('first_day_of_week') ?? 0)) % 7;

        return is_null($value) ? $dayOfWeek : $this->addDays($value - $dayOfWeek);
    }
603810
public static function validateDayOfWeek($dayOfWeek)
    {
        if ($dayOfWeek < self::MONDAY || $dayOfWeek > self::SUNDAY) {
            throw new \InvalidArgumentException(sprintf('Invalid day of week: "%s"', $dayOfWeek));
        }
    }
188848
public function week($field,$which_connection='')
    {
        if ($which_connection == '') {
            $which_connection = $this->default_db;
        }
        $conn = $this->connections[$which_connection];

        return $conn->SQLDate("W",$field);
    }
1295691
public function getOrderPeriodLastDay($day)
    {

        $currentWeekday = $this->formatAsWeekday($day);

        if ($currentWeekday == 7) {
            $currentWeekday = 0;
        }

        if ($currentWeekday == $this->getDeliveryWeekday()) {
            $dateDiff = -1 - Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA');
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 1) % 7) {
            $dateDiff = (Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1) + 5;
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 2) % 7) {
            $dateDiff = (Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1) + 4;
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 3) % 7) {
            $dateDiff = (Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1) + 3;
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 4) % 7) {
            $dateDiff = (Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1) + 2;
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 5) % 7) {
            $dateDiff = (Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1) + 1;
        }
        if ($currentWeekday == ($this->getDeliveryWeekday() + 6) % 7) {
            $dateDiff = Configure::read('appDb.FCS_DEFAULT_SEND_ORDER_LISTS_DAY_DELTA') * -1;
        }

        $date = date($this->getI18Format('DateShortAlt'), strtotime($dateDiff . ' day ', $day));

        return $date;
    }
1082310
private SortedSet<WeekDay> readWeekDays(JSONValue val) {

        JSONArray array = null == val ? null : val.isArray();
        if (null != array) {
            SortedSet<WeekDay> result = new TreeSet<>();
            for (int i = 0; i < array.size(); i++) {
                try {
                    result.add(readWeekDay(array.get(i)));
                } catch (@SuppressWarnings("unused") IllegalArgumentException e) {
                    // Just skip
                }
            }
            return result;
        }
        return new TreeSet<>();
    }
1044465
def _format_week(self, name, type, a_per):
        """"""
        return '{},{},{}/{},{}/{}'.format(name, type, a_per.st_month, a_per.st_day,
                                          a_per.end_month, a_per.end_day)
651756
private function nextOrPreviousDay($weekday = true, $forward = true)
    {
        $step = $forward ? 1 : -1;

        do {
            $this->addDay($step);
        } while ($weekday ? $this->isWeekend() : $this->isWeekday());

        return $this;
    }
573594
def weekly(date=datetime.date.today()):
    
    return date - datetime.timedelta(days=date.weekday())
418167
public function weekday($number, $verbosity = self::VERBOSE)
    {
        return $this->getSymbol(self::WEEKDAY, $number, $verbosity);
    }
1330335
public static function translateWeekday($date, $locale = "en") {

        // Initialize.
        $template = __DIR__ . "/../Resources/translations/messages.%locale%.yml";
        $filename = str_replace("%locale%", $locale, $template);

        // Check if the filename exists.
        if (false === file_exists($filename)) {
            $filename = str_replace("%locale%", "en", $template);
        }

        // Parse the translations.
        $translations = Yaml::parse(file_get_contents($filename));

        // Return the weekday part translated.
        return str_ireplace(array_keys($translations["weekdays"]), array_values($translations["weekdays"]), $date);
    }
1077859
void formatWeekday(StringBuilder b, ZonedDateTime d, int width, FieldVariants weekdays) {
    int weekday = d.getDayOfWeek().getValue() % 7;
    switch (width) {
      case 6:
        b.append(weekdays.short_[weekday]);
        break;

      case 5:
        b.append(weekdays.narrow[weekday]);
        break;

      case 4:
        b.append(weekdays.wide[weekday]);
        break;

      case 3:
      case 2:
      case 1:
        b.append(weekdays.abbreviated[weekday]);
        break;
    }
  }
103826
public function get_starting_weekday() {
        global $CFG;

        if (isset($CFG->calendar_startwday)) {
            $firstday = $CFG->calendar_startwday;
        } else {
            $firstday = get_string('firstdayofweek', 'langconfig');
        }

        if (!is_numeric($firstday)) {
            $startingweekday = CALENDAR_DEFAULT_STARTING_WEEKDAY;
        } else {
            $startingweekday = intval($firstday) % 7;
        }

        return get_user_preferences('calendar_startwday', $startingweekday);
    }