- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_event.php
- Класс: CCalendarEvent
- Вызов: CCalendarEvent::convertDateToCulture
static function convertDateToCulture(string $str): string
{
if (CCalendar::DFormat(false) !== ExcludedDatesCollection::EXCLUDED_DATE_FORMAT)
{
if (preg_match_all("/(d{2}).(d{2}).(d{4})/", $str, $matches))
{
foreach ($matches[0] as $index => $match)
{
$newValue = CCalendar::Date(
mktime(
0,
0,
0,
$matches[2][$index],
$matches[1][$index],
$matches[3][$index]
),
false
);
$str = str_replace($match, $newValue, $str);
}
}
}
return $str;
}