• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/integration/report/handler/base.php
  • Класс: BitrixVoximplantIntegrationReportHandlerBase
  • Вызов: Base::getDateInterval
protected function getDateInterval($timePeriodDatasel, int $seconds = 0): string
{
	$interval = '';

	switch ($timePeriodDatasel)
	{
		case DateType::LAST_WEEK:
		case DateType::CURRENT_WEEK:
			$interval = '1 week';
			break;

		case DateType::LAST_MONTH:
		case DateType::CURRENT_MONTH:
		case DateType::MONTH:
		case DateType::CURRENT_QUARTER:
		case DateType::QUARTER:
			$interval = round($seconds / 2592000) . ' month';
			break;

		case DateType::YEAR:
			$interval = round($seconds / 31536000) . ' year';
			break;

		case DateType::LAST_7_DAYS:
		case DateType::LAST_30_DAYS:
		case DateType::LAST_60_DAYS:
		case DateType::LAST_90_DAYS:
		case DateType::PREV_DAYS:
		case DateType::RANGE:
			$interval = round($seconds / 86400) . ' day';
			break;

		//tmp solution, remove when the problem with "undefined" in the report filter will be solved.
		default:
			$interval = -1 . ' month';
			break;
	}

	return $interval;
}