• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/calc.php
  • Класс: CBPCalc
  • Вызов: CBPCalc::frameNamesInFormattedDateRFC2822
private function frameNamesInFormattedDateRFC2822($formattedDate)
{
	$matches = [];
	$pattern = "/#(w{3}), d{2} (w{3}) d{4} d{2}:d{2}:d{2} [+-]d{4}#/";
	if (preg_match_all($pattern, $formattedDate, $matches))
	{
		foreach ($matches[0] as $key => $match)
		{
			$day = $matches[1][$key];
			$month = $matches[2][$key];

			$reformMatch = str_replace(
				[$day, $month],
				['#' . $day . '#', '#' . $month . '#'],
				$match
			);
			$reformMatch = substr($reformMatch, 1, -1);

			$formattedDate = str_replace($match, $reformMatch, $formattedDate);
		}
	}

	return $formattedDate;
}