You are here

protected function StatsPro::get_last_month_of_quarter_from_reference in Statistics Pro 6.2

Same name and namespace in other branches
  1. 6 statspro.inc \statspro::get_last_month_of_quarter_from_reference()

Returns the last month of same the quarter as the reference day.

Parameters

<int> $reference A timestamp representaing the reference day.:

Return value

<int> Last month of the same quarter of the reference day.

File

./statspro.inc, line 405
statspro class for Statistics Pro module.

Class

StatsPro
Manages the data saving and retrieval according to the user defined parameters.

Code

protected function get_last_month_of_quarter_from_reference($reference) {
  $month = date('m', $reference);
  $last_month = floor(($month - 1) / 3);
  $last_month = (int) (($last_month + 1) * 3);
  return sprintf('%02u', $last_month);
}