Returns correct names for week days

@param $day
@param bool $shorten
@param int $len
@param bool $numeric

@return bool|string
356359
private static function getDayNames($day, $shorten = false, $len = 1, $numeric = false)
    {
        $days = array(
            'sat' => array(1, 'شنبه'),
            'sun' => array(2, 'یکشنبه'),
            'mon' => array(3, 'دوشنبه'),
            'tue' => array(4, 'سه شنبه'),
            'wed' => array(5, 'چهارشنبه'),
            'thu' => array(6, 'پنجشنبه'),
            'fri' => array(7, 'جمعه')
        );

        $day = strtolower( substr( $day, 0, 3 ) );
        $day = $days[$day];

        return $numeric ? $day[0] : ( $shorten ? self::substr($day[1], 0, $len) : $day[1]);
    }
220877
def get_day_name(self) -> str:
        
        weekday = self.value.isoweekday() - 1
        return calendar.day_name[weekday]
944342
function getDaysNames () {
            var daysNameList = [];
            for (var i = 0; i < 7 ; i++) {
                daysNameList.push(moment().weekday(i).format('ddd'));
            }
            return daysNameList;
        }
530093
private static int getDay(Calendar cal, int dayOfWeek, int orderNum){
        int day = cal.getActualMaximum(Calendar.DAY_OF_MONTH);

        cal.set(Calendar.DAY_OF_MONTH, day);
        int lastWeekday = cal.get(Calendar.DAY_OF_WEEK);
        int shift = lastWeekday >= dayOfWeek ? (lastWeekday - dayOfWeek) : (lastWeekday + 7 - dayOfWeek);

        //find last dayOfWeek of this month
        day -= shift;

        if(orderNum < 0)
            return day;

        cal.set(Calendar.DAY_OF_MONTH, day);
        int lastOrderNum = (cal.get(Calendar.DAY_OF_MONTH) - 1) / 7;

        if(orderNum >= lastOrderNum)
            return day;

        return day - (lastOrderNum - orderNum) * 7;
    }
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
690472
public static function fromShortName(string $name) : DayOfWeek
    {
        return self::fromNameMap($name, self::$shortNames, __METHOD__);
    }
456824
def n_day(date_string):
        
        today = datetime.date.today()
        match = re.match(r'(\d{1,3}|a) days? ago', date_string)
        groups = match.groups()
        if groups:
            decrement = groups[0]
            if decrement == 'a':
                decrement = 1
            return today - datetime.timedelta(days=int(decrement))
        return None
511313
public static function getLocalDayName($date, $short=true) {
		$dayName = date('N', strtotime($date));
		switch($dayName) {
			case 0:
			    return ($short ? 'Min' : 'Minggu');
			break;

			case 1:
			    return ($short ? 'Sen' : 'Senin');
			break;

			case 2:
			    return ($short ? 'Sel' : 'Selasa');
			break;

			case 3:
			    return ($short ? 'Rab' : 'Rabu');
			break;

			case 4:
			    return ($short ? 'Kam' : 'Kamis');
			break;

			case 5:
			    return ($short ? 'Jum' : 'Jumat');
			break;

			case 6:
			    return ($short ? 'Sab' : 'Sabtu');
			break;
		}
	}
735818
static function num2week($num, $two = true)
    {
        if ($num == '6')
        {
            $num = '日';
        }
        else
        {
            $num = Tool::num2han($num + 1);
        }
        if ($two)
        {
            return self::WEEK_TWO . $num;
        }
        else
        {
            return self::WEEK_THREE . $num;
        }
    }
1163204
private function getDay($dayNumber)
    {
        return isset($this->days[$dayNumber]) ? $this->days[$dayNumber] : null;
    }
1371734
public static function getLocalMonthName($date, $short=false) {
		if(empty($date))
			return false;
		
		$month = date('m', strtotime($date));

		$bulan = array('Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember');
		$shortBulan = array('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des');

		if($short == true)
			return $shortBulan[$month-1];
		else
			return $bulan[$month-1];
	}
411480
public static function localizeDay(int $day, bool $short = false)
    {
        $date = (new static())
            ->next($day);

        return ucfirst($date->formatLocalized($short ? '%a' : '%A'));
    }
1066110
void formatLocalWeekday(StringBuilder b, ZonedDateTime d, int width, FieldVariants weekdays, int firstDay) {
    if (width > 2) {
      formatWeekday(b, d, width, weekdays);
      return;
    }
    if (width == 2) {
      b.append('0');
    }
    formatWeekdayNumeric(b, d, firstDay);
  }
181701
protected function formatDayZeros(): string
    {
        if ($this->day > 9) {
            return I18N::digits($this->day);
        }

        return I18N::digits('0' . $this->day);
    }
865552
public static function dayStringToNumber($day)
    {
        $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
        if (is_numeric($strippedDayValue)) {
            return (integer) $strippedDayValue;
        }
        return $day;
    }
1358635
private static function translateToDayNames(string $annotation) : array
	{
		static $workingDays = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri',];
		static $weekend = ['Sat', 'Sun',];

		$days = [];
		foreach (static::splitMultipleValues($annotation) as $value) {
			switch ($value) {
				case 'working days':
					$days = array_merge($days, $workingDays);
					break;
				case 'weekend':
					$days = array_merge($days, $weekend);
					break;
				default:
					$days[] = $value;
					break;
			}
		}

		return array_unique($days);
	}
195250
public function getWeekDayNamesNarrow($day = null)
    {
        $calendar = $this->getName();
        // gregorian, generic

        $data = array();
        $calendsFallback = array($calendar, 'gregorian', 'generic');
        foreach ($calendsFallback as $calendar) {
            $data = $this->getRepoReader()->getEntityByPath(
                'dates/calendars/calendar[@type="'.$calendar.'"]/days/dayContext[@type="format"]/dayWidth[@type="abbreviated"]/day'
            );

            if ($data) {
                break;
            }
        }

        $dayOfWeeks = array();
        foreach($data as $d) {
            $dayOfWeeks[$d['type']] = $d['value'];
        }

        $return = ($day == null) ? $dayOfWeeks : false;

        $day = (is_string($day)) ? strtolower($day) : $day;

        if (is_string($day) && isset($dayOfWeeks[$day])) {
            $return = $dayOfWeeks[$day];
        } elseif(is_int($day)) {
            // get with index
            $arrayKeys = array_keys($dayOfWeeks);
            $return    = $dayOfWeeks[$arrayKeys[$day]];
        }

        return $return;
    }