WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Admin\API\Reports

TimeInterval::simple_week_number() public WC 1.0

Returns simple week number for the DateTime, for week starting on $first_day_of_week.

The first week of the year is considered to be the week containing January 1. The second week starts on the next $first_day_of_week.

{} Это метод класса: TimeInterval{}

Хуков нет.

Возвращает

Число.

Использование

$result = TimeInterval::simple_week_number( $datetime, $first_day_of_week );
$datetime(DateTime) (обязательный)
Local date for which the week number is to be calculated.
$first_day_of_week(число) (обязательный)
0 for Sunday to 6 for Saturday.

Код TimeInterval::simple_week_number() WC 4.7.1

<?php
public static function simple_week_number( $datetime, $first_day_of_week ) {
	$beg_of_year_day          = new \DateTime( "{$datetime->format('Y')}-01-01" );
	$adj_day_beg_of_year      = ( (int) $beg_of_year_day->format( 'w' ) - $first_day_of_week + 7 ) % 7;
	$days_since_start_of_year = (int) $datetime->format( 'z' ) + 1;

	return (int) floor( ( ( $days_since_start_of_year + $adj_day_beg_of_year - 1 ) / 7 ) ) + 1;
}