/*!
Returns the same array as in weekDays() but with all days translated to text.
175046
function weekDayNames( $short = false )
    {
        if ( $short )
            $dayList = $this->ShortWeekDayNames;
        else
            $dayList = $this->LongWeekDayNames;

        $resultDayList = array();
        foreach ( $this->WeekDays as $day )
        {
            $resultDayList[ $day ] = $dayList[ $day ];
        }
        return $resultDayList;
    }
115467
function fixDay(days) {
		var s = [], i;
		for (i = 1; i < days.length; i++) {
			s.push(days[i]);
		}
		s.push(days[0]);
		return s;
	}
640426
public static function dayList($length = 0)
    {
        $dayNameArray = explode(',', $this->dayNames);
        for ($i = 1; $i <= 7; $i++) {
            if ($length == 0) {
                $dayList[$i] = trim($dayNameArray[$i - 1]);
            } else {
                $dayList[$i] = substr(trim($dayNameArray[$i - 1]), 0, $length);
            }
        }

        return $dayList;
    }
67940
function(html) {

        html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';

        if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)) {
            html[html.length] = '<th>&#160;</th>';
        }

        for(var i=0;i < this.Locale.LOCALE_WEEKDAYS.length; ++i) {
            html[html.length] = '<th class="' + this.Style.CSS_WEEKDAY_CELL + '">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
        }

        if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)) {
            html[html.length] = '<th>&#160;</th>';
        }

        html[html.length] = '</tr>';

        return html;
    }
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
707783
protected function getInlineJavaScriptTranslations()
    {
        /*
         * This date is arbitrary and is just used for getting week and
         * month names.
         */
        $date = new SwatDate();
        $date->setDay(1);
        $date->setMonth(1);
        $date->setYear(1995);

        // Get the names of weeks (locale-specific)
        $week_names = array();
        for ($i = 1; $i < 8; $i++) {
            $week_names[] = $date->formatLikeIntl('EEE');
            $date->setDay($i + 1);
        }
        $week_names = "['" . implode("', '", $week_names) . "']";

        // Get the names of months (locale-specific)
        $month_names = array();
        for ($i = 1; $i < 13; $i++) {
            $month_names[] = $date->formatLikeIntl('MMM');
            $date->setMonth($i + 1);
        }
        $month_names = "['" . implode("', '", $month_names) . "']";

        $prev_alt_text = Swat::_('Previous Month');
        $next_alt_text = Swat::_('Next Month');
        $close_text = Swat::_('Close');
        $nodate_text = Swat::_('No Date');
        $today_text = Swat::_('Today');

        $open_toggle_text = Swat::_('open calendar');
        $close_toggle_text = Swat::_('close calendar');

        return "SwatCalendar.week_names = {$week_names};\n" .
            "SwatCalendar.month_names = {$month_names};\n" .
            "SwatCalendar.prev_alt_text = '{$prev_alt_text}';\n" .
            "SwatCalendar.next_alt_text = '{$next_alt_text}';\n" .
            "SwatCalendar.close_text = '{$close_text}';\n" .
            "SwatCalendar.nodate_text = '{$nodate_text}';\n" .
            "SwatCalendar.today_text = '{$today_text}';\n" .
            "SwatCalendar.open_toggle_text = '{$open_toggle_text}';\n" .
            "SwatCalendar.close_toggle_text = '{$close_toggle_text}';\n";
    }
1329027
public static function getWeekDays()
    {
        static $weekdays = null;
        if ($weekdays == null) {
            $weekdays   = array();
            for ($i = 0; $i < 7; $i++) {
                $weekdays[$i] = strftime('%A', mktime(0, 0, 0, 1, $i, 2001));
            }
        }
        return $weekdays;
    }
1076417
private String[] weekdayMap(JsonObject node) {
    String[] res = new String[7];
    for (int i = 0; i < 7; i++) {
      res[i] = node.get(WEEKDAY_KEYS[i]).getAsString();
    }
    return res;
  }
562334
protected function get_all_day_row() {

		// Items that last an entire day, maybe for multiple
		$type = 'all_day_items';

		// Start an output buffer
		ob_start(); ?>

		<tr class="all-day">
			<th><?php esc_html_e( 'All day', 'wp-event-calendar' ); ?></th>
			<td><?php echo $this->get_day_row_cell( 0, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 1, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 2, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 3, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 4, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 5, $type ); ?></td>
			<td><?php echo $this->get_day_row_cell( 6, $type ); ?></td>
		</tr>

		<?php

		// Return the output buffer
		return ob_get_clean();
	}
944342
function getDaysNames () {
            var daysNameList = [];
            for (var i = 0; i < 7 ; i++) {
                daysNameList.push(moment().weekday(i).format('ddd'));
            }
            return daysNameList;
        }
169730
private static function expandDaysRange(array $days) : array
	{
		static $dayNames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun',];
		$expandedValues = [];

		foreach ($days as $day) {
			if (Strings::match($day, '~^\w{3}\s*-\s*\w{3}$~u')) {
				list($begin, $end) = Strings::split($day, '~\s*-\s*~');
				$started = FALSE;
				foreach ($dayNames as $dayName) {
					if ($dayName === $begin) {
						$started = TRUE;
					}
					if ($started) {
						$expandedValues[] = $dayName;
					}
					if ($dayName === $end) {
						$started = FALSE;
					}
				}
			} else {
				$expandedValues[] = $day;
			}
		}

		return array_unique($expandedValues);
	}
786937
def weekday(cls, year, month, day):
        """"""
        return NepDate.from_bs_date(year, month, day).weekday()
1011638
function getDateTranslation(date, locale, name, width, form, extended) {
    switch (name) {
        case TranslationType.Months:
            return getLocaleMonthNames(locale, form, width)[date.getMonth()];
        case TranslationType.Days:
            return getLocaleDayNames(locale, form, width)[date.getDay()];
        case TranslationType.DayPeriods:
            var /** @type {?} */ currentHours_1 = date.getHours();
            var /** @type {?} */ currentMinutes_1 = date.getMinutes();
            if (extended) {
                var /** @type {?} */ rules = getLocaleExtraDayPeriodRules(locale);
                var /** @type {?} */ dayPeriods_1 = getLocaleExtraDayPeriods(locale, form, width);
                var /** @type {?} */ result_1;
                rules.forEach(function (rule, index) {
                    if (Array.isArray(rule)) {
                        // morning, afternoon, evening, night
                        var _a = rule[0], hoursFrom = _a.hours, minutesFrom = _a.minutes;
                        var _b = rule[1], hoursTo = _b.hours, minutesTo = _b.minutes;
                        if (currentHours_1 >= hoursFrom && currentMinutes_1 >= minutesFrom &&
                            (currentHours_1 < hoursTo ||
                                (currentHours_1 === hoursTo && currentMinutes_1 < minutesTo))) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                    else {
                        // noon or midnight
                        var hours = rule.hours, minutes = rule.minutes;
                        if (hours === currentHours_1 && minutes === currentMinutes_1) {
                            result_1 = dayPeriods_1[index];
                        }
                    }
                });
                if (result_1) {
                    return result_1;
                }
            }
            // if no rules for the day periods, we use am/pm by default
            return getLocaleDayPeriods(locale, form, /** @type {?} */ (width))[currentHours_1 < 12 ? 0 : 1];
        case TranslationType.Eras:
            return getLocaleEraNames(locale, /** @type {?} */ (width))[date.getFullYear() <= 0 ? 0 : 1];
    }
}
237264
def weekday_to_str(
    weekday: Union[int, str], *, inverse: bool = False
) -> Union[int, str]:
    
    s = [
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday",
        "saturday",
        "sunday",
    ]
    if not inverse:
        try:
            return s[weekday]
        except:
            return
    else:
        try:
            return s.index(weekday)
        except:
            return
205417
public function transform($weeklyPattern)
    {
        if (null === $weeklyPattern) {
            return null;
        }

        $selectedDays = array_filter(str_split($weeklyPattern), function ($value) {
            return $value == 1;
        });

        return array_keys($selectedDays);
    }
1174423
private int getDaysToNextMatch(WeekDay weekDay) {

        for (WeekDay wd : m_weekDays) {
            if (wd.compareTo(weekDay) > 0) {
                return wd.toInt() - weekDay.toInt();
            }
        }
        return (m_weekDays.iterator().next().toInt() + (m_interval * I_CmsSerialDateValue.NUM_OF_WEEKDAYS))
            - weekDay.toInt();
    }
786047
function getWeeks (date) {

                    var weeks = [];
                    var date = moment.utc(date);
                    var firstDayOfMonth = moment(date).date(1);
                    var lastDayOfMonth  = moment(date).date(date.daysInMonth());

                    var startDay = moment(firstDayOfMonth);
                    var endDay   = moment(lastDayOfMonth);
                    // NB: We use weekday() to get a locale aware weekday
                    startDay = firstDayOfMonth.weekday() === 0 ? startDay : startDay.weekday(0);
                    endDay   = lastDayOfMonth.weekday()  === 6 ? endDay   : endDay.weekday(6);

                    var currentWeek = [];

                    for (var start = moment(startDay); start.isBefore(moment(endDay).add(1, 'days')); start.add(1, 'days')) {

                        var afterMinDate  = !scope.config.minDate || start.isAfter(scope.config.minDate, 'day');
                        var beforeMaxDate = !scope.config.maxDate || start.isBefore(scope.config.maxDate, 'day');
                        var isFuture      = start.isAfter(today);
                        var beforeFuture  = scope.config.allowFuture || !isFuture;

                        var day = {
                            date: moment(start).toDate(),
                            isToday: start.isSame(today, 'day'),
                            isInMonth: start.isSame(firstDayOfMonth, 'month'),
                            isSelected: start.isSame(dateSelected, 'day'),
                            isSelectable: afterMinDate && beforeMaxDate && beforeFuture
                        };

                        currentWeek.push(day);

                        if (start.weekday() === 6 || start === endDay) {
                            weeks.push(currentWeek);
                            currentWeek = [];
                        }
                    }

                    return weeks;
                }