• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/handler/salesdynamics/basegraph.php
  • Класс: Bitrix\Crm\Integration\Report\Handler\SalesDynamics\BaseGraph
  • Вызов: BaseGraph::getDatesRange
static function getDatesRange(Date $from, Date $to, $step = self::STEP_DAY)
{
	$fromTimestamp = $from->getTimestamp();
	$toTimestamp = $to->getTimestamp();
	if($toTimestamp < $fromTimestamp)
	{
		throw new ArgumentException(Loc::getMessage("CRM_REPORT_SALES_DYNAMICS_ERROR_DATE_FROM_SHOULD_PRECED_DATE_TO"));
	}

	$currentDate = clone($from);

	while ($currentDate->getTimestamp() <= $toTimestamp)
	{
		yield $currentDate;

		$currentDate = clone($currentDate);
		$currentDate->add($step);
	}
}