• Модуль: subscribe
  • Путь к файлу: ~/bitrix/modules/subscribe/classes/general/template.php
  • Класс: CPostingTemplate
  • Вызов: CPostingTemplate::ParseTimesOfDay
static function ParseTimesOfDay($strTimesOfDay)
{
	if($strTimesOfDay == '')
		return false;

	$arResult = array();

	$arToD = explode(",", $strTimesOfDay);
	foreach($arToD as $strToD)
	{
		$arFound = array();
		if(
			preg_match("/^(d{1,2}):(d{1,2})$/", trim($strToD), $arFound)
			&& $arFound[1] <= 23
			&& $arFound[2] <= 59
		)
		{
			$arResult[]=intval($arFound[1])*3600+intval($arFound[2])*60;
		}
		else
		{
			return false;
		}
	}

	return $arResult;
}