• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/tzgen.php
  • Класс: TZConvTransitionRule
  • Вызов: TZConvTransitionRule::getNumWk
static function getNumWk(DateTime $date)
{
	$num = ceil($date->format('j') / 7);

	if ($num > 2)
	{
		$tester = clone $date;
		$tester->modify("last {$date->format('l')} of this month");

		$num = -1 * (1 + (($tester->format('j') - $date->format('j')) / 7));
	}

	return $num;
}