Builds Table Row with Week Days.
@access		protected
@return		string
767528
protected function buildWeekDays()
	{
		foreach( $this->days as $day )
			$days[]	= UI_HTML_Tag::create( "div", $day, array( 'class' => "weekday" ) );
		$days	= implode( "", $days );
		$code	= UI_HTML_Tag::create( "div", $days, array( 'class' => "weekdays" ) );
		return $code;
	}
1367613
public function toString() {
    $text = '';
    $args = array();

    $start_date = FALSE;
    $end_date = FALSE;

    // Day of the week constraint variable.
    $day_of_the_week = $this->getWeekDay($this->checkin_day);

    // Date range constraint variables.
    if ($this->start_date !== NULL && $this->start_date != (new \DateTime('1970-01-01'))) {
      $start_date = $this->start_date->format('Y-m-d');
    }
    if ($this->end_date !== NULL && $this->end_date != (new \DateTime('2999-12-31'))) {
      $end_date = $this->end_date->format('Y-m-d');
    }

    // Finally, build out the constraint text string adding components
    // as necessary.

    // Specify a date range constraint.
    if ($start_date && $end_date) {
      $text = 'From @start_date to @end_date';

      $args['@start_date'] = $start_date;
      $args['@end_date'] = $end_date;
    }

    // Specify the day of the week constraint.
    if ($day_of_the_week) {
      if ($start_date && $end_date) {
        $text = 'From @start_date to @end_date, bookings must start on @day_of_the_week';
      } else {
        $text = 'Bookings must start on @day_of_the_week';
      }

      $args['@day_of_the_week'] = $day_of_the_week;
    }

    return array('text' => $text, 'args' => $args);
  }
414153
public function build()
    {
        if ($this->currentDate === null) {
            return null;
        }
        return new Week($this->currentDate, $this->startDay);
    }
566943
public static function getWeekdayFullname($day = null)
    {
        if ($day === null) {
            $day = new AnDate();
        }
        if ($day instanceof AnDate) {
            $weekday = self::getDayOfWeek($day);
        } elseif (is_int($day)) {
            $weekday = $day;
        }
        $names = self::getWeekDays();
        return $names[$weekday];
    }
1182993
public function asHtml($config)
    {
        $class = $config['class'];
        $dates = $config['dates'];

        $daysOfTheWeek = [
            'Monday',
            'Tuesday',
            'Wednesday',
            'Thursday',
            'Friday',
            'Saturday',
            'Sunday',
        ];

        $output = '<table class="'.$class.'">';
        $output .= '<thead>';
        foreach ($daysOfTheWeek as $day) {
            $output .= '<th>'.$day.'</th>';
        }
        $output .= '</thead>';

        foreach ($this->weeks as $week) {
            $output .= '<tr>';
            foreach (range(1, 7) as $dayAsNumber) {
                if (isset($week[$dayAsNumber])) {
                    $content = '';
                    if (isset($dates[$week[$dayAsNumber]->toDateString()])) {
                        $content = $dates[$week[$dayAsNumber]->toDateString()];
                    }

                    if (is_array($content)) {
                        $itemString = '';
                        foreach ($content as $item) {
                            if (config('app.locale') !== config('cms.default-language')) {
                                if ($item->translationData(config('app.locale'))) {
                                    $itemString .= '<a href="'.url('events/event/'.$item->id).'">'.$item->translationData(config('app.locale'))->title.'</a><br>';
                                }
                            } else {
                                $itemString .= '<a href="'.url('events/event/'.$item->id).'">'.$item->title.'</a><br>';
                            }
                        }
                        $content = $itemString;
                    }

                    $output .= '<td><span class="date"><a href="'.url('events/date/'.$week[$dayAsNumber]->format('Y-m-d')).'">'.$week[$dayAsNumber]->toFormattedDateString().'</a></span><span class="content">'.$content.'</span></td>';
                } else {
                    $output .= '<td>&nbsp;</td>';
                }
            }
            $output .= '</tr>';
        }
        $output .= '</table>';

        return $output;
    }
182625
public function days()
    {
        if (!isset($this->days)) {
            $clonedStart = clone $this->weekStart;
            $this->days = array();
            for ($i = 0; $i < 7; $i ++) {
                $thisDay = new Day($clonedStart);

                if (
                    $this->containingMonth
                    && $this->containingMonth->firstDay()->format('m') != $clonedStart->format('m')
                ) {
                    $thisDay->setIsOverflow(true);
                }

                $this->days[] = $thisDay;
                $clonedStart->modify('+1 day');
            }
        }
        return $this->days;
    }
289102
public static function weekRange()
    {
        $timestamp = time();
        return [
            strtotime(date('Y-m-d', strtotime("+0 week Monday", $timestamp))),
            strtotime(date('Y-m-d', strtotime("+0 week Sunday", $timestamp))) + 24 * 3600 - 1
        ];
    }
1210103
private function renderRowHtml()
    {
        $data = $this->getTable()->getData();
        $headers = $this->getTable()->getHeaders();
        $render = '';

        foreach ($data as $rowData) {
            $this->setActualRow($rowData);
            $rowRender = '';

            foreach ($headers as $name => $options) {
                $rowRender .= $this->getTable()->getHeader($name)->getCell()->render('html');
            }

            foreach ($this->decorators as $decorator) {
                $decorator->render('');
            }

            $render .= sprintf('<tr %s>%s</tr>', $this->getAttributes(), $rowRender);
            $this->clearVar();
        }
        return $render;
    }
588383
public function get_weekdays() {
        return array(
            0 => array(
                'shortname' => get_string('sun', 'calendar'),
                'fullname' => get_string('sunday', 'calendar')
            ),
            1 => array(
                'shortname' => get_string('mon', 'calendar'),
                'fullname' => get_string('monday', 'calendar')
            ),
            2 => array(
                'shortname' => get_string('tue', 'calendar'),
                'fullname' => get_string('tuesday', 'calendar')
            ),
            3 => array(
                'shortname' => get_string('wed', 'calendar'),
                'fullname' => get_string('wednesday', 'calendar')
            ),
            4 => array(
                'shortname' => get_string('thu', 'calendar'),
                'fullname' => get_string('thursday', 'calendar')
            ),
            5 => array(
                'shortname' => get_string('fri', 'calendar'),
                'fullname' => get_string('friday', 'calendar')
            ),
            6 => array(
                'shortname' => get_string('sat', 'calendar'),
                'fullname' => get_string('saturday', 'calendar')
            ),
        );
    }
1373059
public function startOfWeek()
        {
            if ($this->dayOfWeek != self::MONDAY) $this->previous(self::MONDAY);

            return $this->startOfDay();
        }
249099
public function dayNames(int $day_number): string
    {
        static $translated_day_names;

        if ($translated_day_names === null) {
            $translated_day_names = [
                0 => I18N::translate('Monday'),
                1 => I18N::translate('Tuesday'),
                2 => I18N::translate('Wednesday'),
                3 => I18N::translate('Thursday'),
                4 => I18N::translate('Friday'),
                5 => I18N::translate('Saturday'),
                6 => I18N::translate('Sunday'),
            ];
        }

        return $translated_day_names[$day_number];
    }
279980
public function get_columns() {

		// Lowercase day, for column key
		$day = strtolower( date( 'l', $this->day_start ) );

		// Return Week & Day
		return array(
			'hour' => sprintf( esc_html__( 'Wk. %s', 'wp-event-calendar' ), date_i18n( 'W', $this->today ) ),
			$day   => date_i18n( 'l, F j, Y', $this->day_start ),
		);
	}
715422
private function tableRows()
    {
        $output = [];

        $filesContent = [];

        foreach ($this->files as $languageKey => $file) {
            foreach ($filesContent[$languageKey] = Arr::dot($this->manager->getFileContent($file)) as $key => $value) {
                if (! $this->shouldShowKey($key)) {
                    continue;
                }

                $output[$key]['key'] = $key;
                $output[$key][$languageKey] = $value ?: '';
            }
        }

        // Now that we have collected all existing values, we are going to fill the
        // missing ones with emptiness indicators to balance the table structure
        // and alert developers so that they can take proper actions.
        foreach ($output as $key => $values) {
            $original = [];

            foreach ($this->languages as $languageKey) {
                $original[$languageKey] = isset($values[$languageKey]) && $values[$languageKey]
                    ? $values[$languageKey]
                    : '<bg=red>  MISSING  </>';
            }

            // Sort the language values based on language name
            ksort($original);

            $output[$key] = array_merge(['key' => "<fg=yellow>$key</>"], $original);
        }

        return array_values($output);
    }
1236524
public function makeSchedule()
    {
        // Pull out the first page to distribute it; then delete.
        $items = $this->getRows();
        $id = $this->getCurrentPageId();
        $this->deletePage($id);

        $this->date = clone $this->getStartDate();
        $this->avoidHolidaysAndWeekdaysOff();
        $this->stats['start date'] = $this->date->format($this->getPageIdFormat());
        $this->stats['hours per day'] = $this->getHoursPerDay();
        $this->stats['total items'] = count($items);
        $this->stats['dates off'] = array();
        $this->setDatePage($this->date);

        $dayTotal = 0;
        $this->stats['total hours'] = 0;
        while (($item = array_shift($items))) {
            $this->stats['total hours'] += $item[$this->getHoursKey()];
            $this->processItem($item, $item[$this->getHoursKey()], $dayTotal);
        }
        $this->stats['end date'] = $this->date->format($this->getPageIdFormat());

        if ($this->todoStatsPage) {
            $this->addStatsPage($this->todoStatsPage);
        }

        return $this;
    }
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);
    }
512842
public function getRows()
    {
        $out = new ArrayList();
        foreach ($this->rows as $row) {
            $columns = new ArrayList();
            foreach ($row as $column => $value) {
                $columns->push(
                    new ArrayData(array(
                        "Heading"=> $column,
                        "Value" => $value
                    ))
                );
            }
            $out->push(
                new ArrayData(array(
                    "Columns" => $columns
                ))
            );
        }
        return $out;
    }
176906
public function ___build(): string
    {
        $tables = \implode(', ', $this->tables);
        $fields = \implode(', ', $this->fields);

        return \sprintf('REPLACE INTO %s SET %s', $tables, $fields);
    }