• Модуль: report
  • Путь к файлу: ~/bitrix/modules/report/lib/visualconstructor/fields/valuable/timeperiod.php
  • Класс: BitrixReportVisualConstructorFieldsValuableTimePeriod
  • Вызов: TimePeriod::prepareTimePeriodForLastDays
private function prepareTimePeriodForLastDays($dayCount = 0)
{
	$nextDay = strtotime("+1 day", time());
	$nextDay = date('Y-m-d', $nextDay);
	$agoDays = strtotime("-" . $dayCount . " day", time());
	$agoDays = date('Y-m-d', $agoDays);

	return array(
		'start' => new DateTime($agoDays, 'Y-m-d H:i'),
		'end' => new DateTime($nextDay, 'Y-m-d H:i'),
	);
}