Start the week with a table row

@since 0.1.0
761985
protected function get_row_cell( $iterator = 1, $start_day = 1 ) {

		// Calculate the day of the month
		$day_of_month = (int) ( $iterator - (int) $start_day + 1 );

		// Calculate link to day view
		$link_to_day  = add_query_arg( array(
			'mode' => 'day',
			'cy'   => $this->year,
			'cm'   => $this->month,
			'cd'   => $day_of_month
		), $this->get_base_url() );

		// Link to add new event on this day
		$add_event_for_day = add_query_arg( array(
			'post_type' => wp_event_calendar_get_admin_post_type(),
			'start_day' => strtotime( "{$this->month}/{$day_of_month}/{$this->year}" )
		), admin_url( 'post-new.php' ) ); ?>

		<td class="<?php echo $this->get_day_classes( $iterator, $start_day ); ?>">
			<a href="<?php echo esc_url( $link_to_day ); ?>" class="day-number">
				<?php echo (int) $day_of_month; ?>
			</a>

			<a href="<?php echo esc_url( $add_event_for_day ); ?>" class="add-event-for-day">
				<i class="dashicons dashicons-plus"></i>
			</a>

			<div class="events-for-cell">
				<?php echo $this->get_posts_for_cell( $day_of_month ); ?>
			</div>
		</td>

		<?php
	}
807092
public function start()
    {
        $data = Utility::get($this->params, "data", array());
        if ($data && count($data)>0) {
            switch($this->dataFormat)
            {
            case "table":
                $columnNames = $data[0];
                $metaData = array("columns"=>array());
                for ($i=0;$i<count($columnNames);$i++) {
                    $metaData["columns"][$columnNames[$i]] = array(
                        "type"=>(isset($data[1]))
                            ?$this->guessType($data[1][$i]):"unknown",
                    );;
                }
                $this->sendMeta($metaData, $this);
                $this->startInput(null);
                $rowNum = count($data);
                for ($i=1;$i<$rowNum;$i++) {
                    $this->next(array_combine($columnNames, $data[$i]), $this);
                }
                break;
            case "associate":
            default:
                $metaData = array("columns"=>array());
                foreach ($data[0] as $key=>$value) {
                    $metaData["columns"][$key]=array(
                        "type"=>$this->guessType($value),
                    );
                }
                $this->sendMeta($metaData, $this);
                $this->startInput(null);
                foreach ($data as $row) {
                    $this->next($row);
                }
                break;
            }
        }
        $this->endInput(null);
    }
545078
def row2table(soup, table, row):
    """"""
    tr = Tag(soup, name="tr")
    table.append(tr)
    for attr in row:
        td = Tag(soup, name="td")
        tr.append(td)
        td.append(attr)
634896
private void setWeekDays(SortedSet<WeekDay> weekDays) {

        List<CmsCheckBox> checked = new ArrayList<CmsCheckBox>();

        for (WeekDay day : weekDays) {
            for (CmsCheckBox box : m_checkboxes) {
                if (box.getInternalValue().equals(day.toString())) {
                    checked.add(box);
                }
            }
        }
        for (CmsCheckBox box : m_checkboxes) {
            if (checked.contains(box)) {
                box.setChecked(true);
            } else {
                box.setChecked(false);
            }
        }

    }
391310
public function onMondayThroughFriday()
    {
        $this->daysOfWeek = [
            DateBuilder::MONDAY,
            DateBuilder::THURSDAY,
            DateBuilder::WEDNESDAY,
            DateBuilder::THURSDAY,
            DateBuilder::FRIDAY
        ];

        return $this;
    }
894498
public void populateSalary(ResultSet row, ObjectNode s) throws SQLException {
    s.put("employeeId", row.getInt("emp_no"));
    s.put("salary", row.getInt("salary"));
    Calendar fromDate = Calendar.getInstance();
    fromDate.setTime(row.getDate("from_date"));
    s.put("fromDate", dateFormat.format(fromDate.getTime()));
    Calendar toDate = Calendar.getInstance();
    toDate.setTime(row.getDate("to_date"));
    s.put("toDate", dateFormat.format(toDate.getTime()));
  }
1065352
def this_week():
        
        since = TODAY + delta(weekday=MONDAY(-1))
        until = since + delta(weeks=1)
        return Date(since), Date(until)
1101167
public function setWeekStartDay($weekStartDay)
	{
		if (is_numeric($weekStartDay))
		{
			$this->weekStartDay = $weekStartDay;
		}
		else
		{
			$this->weekStartDay = array_search(strtolower($weekStartDay), array('sunday', 'monday'));
		}

		return $this;
	}
720568
public static void sqlweek(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
    singleArgumentFunctionCall(buf, "extract(week from ", "week", parsedArgs);
  }
841502
public function change()
    {
        $table = $this->table('calendar_events');
        $table->addIndex(['calendar_id']);
        $table->addIndex(['is_recurring']);
        $table->addIndex(['start_date']);
        $table->addIndex(['end_date']);
        $table->update();
    }
187849
public function weekly()
    {
        $this->setScheduleMonth(self::ANY);
        $this->setScheduleWeek(self::ANY);
        $this->setScheduleDayOfMonth(self::ANY);
        $this->setScheduleDayOfWeek(Day::SUNDAY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }
1143092
def on_rows(self, rowiter):
        
        self.__rows = rowiter
        self._d.callback(self)
        self._d = None
976147
function(workingDate, html) {

        var startDay = this.cfg.getProperty(DEF_CFG.START_WEEKDAY.key);

        this.preMonthDays = workingDate.getDay();
        if (startDay > 0) {
            this.preMonthDays -= startDay;
        }
        if (this.preMonthDays < 0) {
            this.preMonthDays += 7;
        }

        this.monthDays = DateMath.findMonthEnd(workingDate).getDate();
        this.postMonthDays = Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;


        workingDate = DateMath.subtract(workingDate, DateMath.DAY, this.preMonthDays);
    
        var weekNum,
            weekClass,
            weekPrefix = "w",
            cellPrefix = "_cell",
            workingDayPrefix = "wd",
            dayPrefix = "d",
            cellRenderers,
            renderer,
            t = this.today,
            cfg = this.cfg,
            todayYear = t.getFullYear(),
            todayMonth = t.getMonth(),
            todayDate = t.getDate(),
            useDate = cfg.getProperty(DEF_CFG.PAGEDATE.key),
            hideBlankWeeks = cfg.getProperty(DEF_CFG.HIDE_BLANK_WEEKS.key),
            showWeekFooter = cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key),
            showWeekHeader = cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key),
            mindate = cfg.getProperty(DEF_CFG.MINDATE.key),
            maxdate = cfg.getProperty(DEF_CFG.MAXDATE.key),
            yearOffset = this.Locale.YEAR_OFFSET;

        if (mindate) {
            mindate = DateMath.clearTime(mindate);
        }
        if (maxdate) {
            maxdate = DateMath.clearTime(maxdate);
        }

        html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';

        var i = 0,
            tempDiv = document.createElement("div"),
            cell = document.createElement("td");

        tempDiv.appendChild(cell);

        var cal = this.parent || this;

        for (var r=0;r<6;r++) {
            weekNum = DateMath.getWeekNumber(workingDate, startDay);
            weekClass = weekPrefix + weekNum;

            // Local OOM check for performance, since we already have pagedate
            if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
                break;
            } else {
                html[html.length] = '<tr class="' + weekClass + '">';

                if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }

                for (var d=0; d < 7; d++){ // Render actual days

                    cellRenderers = [];

                    this.clearElement(cell);
                    cell.className = this.Style.CSS_CELL;
                    cell.id = this.id + cellPrefix + i;

                    if (workingDate.getDate()  == todayDate && 
                        workingDate.getMonth()  == todayMonth &&
                        workingDate.getFullYear() == todayYear) {
                        cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
                    }

                    var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
                    this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates

                    // Local OOM check for performance, since we already have pagedate
                    if (workingDate.getMonth() != useDate.getMonth()) {
                        cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
                    } else {
                        Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
                        Dom.addClass(cell, dayPrefix + workingDate.getDate());

                        for (var s=0;s<this.renderStack.length;++s) {

                            renderer = null;

                            var rArray = this.renderStack[s],
                                type = rArray[0],
                                month,
                                day,
                                year;

                            switch (type) {
                                case Calendar.DATE:
                                    month = rArray[1][1];
                                    day = rArray[1][2];
                                    year = rArray[1][0];

                                    if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
                                        renderer = rArray[2];
                                        this.renderStack.splice(s,1);
                                    }
                                    break;
                                case Calendar.MONTH_DAY:
                                    month = rArray[1][0];
                                    day = rArray[1][1];

                                    if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
                                        renderer = rArray[2];
                                        this.renderStack.splice(s,1);
                                    }
                                    break;
                                case Calendar.RANGE:
                                    var date1 = rArray[1][0],
                                        date2 = rArray[1][1],
                                        d1month = date1[1],
                                        d1day = date1[2],
                                        d1year = date1[0],
                                        d1 = DateMath.getDate(d1year, d1month-1, d1day),
                                        d2month = date2[1],
                                        d2day = date2[2],
                                        d2year = date2[0],
                                        d2 = DateMath.getDate(d2year, d2month-1, d2day);

                                    if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
                                        renderer = rArray[2];

                                        if (workingDate.getTime()==d2.getTime()) { 
                                            this.renderStack.splice(s,1);
                                        }
                                    }
                                    break;
                                case Calendar.WEEKDAY:
                                    var weekday = rArray[1][0];
                                    if (workingDate.getDay()+1 == weekday) {
                                        renderer = rArray[2];
                                    }
                                    break;
                                case Calendar.MONTH:
                                    month = rArray[1][0];
                                    if (workingDate.getMonth()+1 == month) {
                                        renderer = rArray[2];
                                    }
                                    break;
                            }

                            if (renderer) {
                                cellRenderers[cellRenderers.length]=renderer;
                            }
                        }

                    }

                    if (this._indexOfSelectedFieldArray(workingArray) > -1) {
                        cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
                    }

                    if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
                        (maxdate && (workingDate.getTime() > maxdate.getTime()))
                    ) {
                        cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
                    } else {
                        cellRenderers[cellRenderers.length]=cal.styleCellDefault;
                        cellRenderers[cellRenderers.length]=cal.renderCellDefault; 
                    }

                    for (var x=0; x < cellRenderers.length; ++x) {
                        if (cellRenderers[x].call(cal, workingDate, cell) == Calendar.STOP_RENDER) {
                            break;
                        }
                    }

                    workingDate.setTime(workingDate.getTime() + DateMath.ONE_DAY_MS);
                    // Just in case we crossed DST/Summertime boundaries
                    workingDate = DateMath.clearTime(workingDate);

                    if (i >= 0 && i <= 6) {
                        Dom.addClass(cell, this.Style.CSS_CELL_TOP);
                    }
                    if ((i % 7) === 0) {
                        Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
                    }
                    if (((i+1) % 7) === 0) {
                        Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
                    }

                    var postDays = this.postMonthDays; 
                    if (hideBlankWeeks && postDays >= 7) {
                        var blankWeeks = Math.floor(postDays/7);
                        for (var p=0;p<blankWeeks;++p) {
                            postDays -= 7;
                        }
                    }
                    
                    if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
                        Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
                    }
    
                    html[html.length] = tempDiv.innerHTML;
                    i++;
                }
    
                if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
    
                html[html.length] = '</tr>';
            }
        }
    
        html[html.length] = '</tbody>';
    
        return html;
    }
800116
public function week($name, $value = null, $options = array())
    {        
		return $this->input('week', $name, $value, $options);
    }
85877
public void setFirstDayOfWeek(int value)
    {
        if (firstDayOfWeek != value) {
            if (value < SUNDAY || value > SATURDAY) {
                throw new IllegalArgumentException("Invalid day of week");
            }
            firstDayOfWeek = value;
            areFieldsSet = false;
        }
    }
1255187
def start_of_week=(start_of_week)
      validator = EnumAttributeValidator.new('String', ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"])
      unless validator.valid?(start_of_week)
        fail ArgumentError, "invalid value for 'start_of_week', must be one of #{validator.allowable_values}."
      end
      @start_of_week = start_of_week
    end
782045
function startOfIsoWeek (y, w) {
    const dow = isoDow(y, 1, 1);
    const startDay = dow > 4 ? 9 - dow : 2 - dow;
    const startDate = new Date(y, 0, startDay);
    return addDays(startDate, (w - 1) * 7);
}