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

Automattic\WooCommerce\Admin\API\Reports

TimeInterval::db_datetime_format() public WC 1.0

Returns date format to be used as grouping clause in SQL.

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

Хуков нет.

Возвращает

Разное.

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

$result = TimeInterval::db_datetime_format( $time_interval, $table_name );
$time_interval(строка) (обязательный)
Time interval.
$table_name(строка) (обязательный)
Name of the db table relevant for the date constraint.

Код TimeInterval::db_datetime_format() WC 4.7.1

<?php
public static function db_datetime_format( $time_interval, $table_name ) {
	$first_day_of_week = absint( get_option( 'start_of_week' ) );

	if ( 1 === $first_day_of_week ) {
		// Week begins on Monday, ISO 8601.
		$week_format = "DATE_FORMAT({$table_name}.date_created, '%x-%v')";
	} else {
		// Week begins on day other than specified by ISO 8601, needs to be in sync with function simple_week_number.
		$week_format = "CONCAT(YEAR({$table_name}.date_created), '-', LPAD( FLOOR( ( DAYOFYEAR({$table_name}.date_created) + ( ( DATE_FORMAT(MAKEDATE(YEAR({$table_name}.date_created),1), '%w') - $first_day_of_week + 7 ) % 7 ) - 1 ) / 7  ) + 1 , 2, '0'))";

	}

	// Whenever this is changed, double check method time_interval_id to make sure they are in sync.
	$mysql_date_format_mapping = array(
		'hour'    => "DATE_FORMAT({$table_name}.date_created, '%Y-%m-%d %H')",
		'day'     => "DATE_FORMAT({$table_name}.date_created, '%Y-%m-%d')",
		'week'    => $week_format,
		'month'   => "DATE_FORMAT({$table_name}.date_created, '%Y-%m')",
		'quarter' => "CONCAT(YEAR({$table_name}.date_created), '-', QUARTER({$table_name}.date_created))",
		'year'    => "YEAR({$table_name}.date_created)",

	);

	return $mysql_date_format_mapping[ $time_interval ];
}