Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.6
-
Fix Version/s: 4.4.0
-
Component/s: CiviReport, Core CiviCRM
-
Labels:None
Description
In CRM_Core_Form_Date we find relative dates defined as follows around line 116
'greater.year' => ts('Current Year to-date'),
'greater.quarter' => ts('Current Quarter to-date'),
'greater.month' => ts('Current Month to-date'),
'greater.week' => ts('Current Week to-date'),
'greater.day' => ts('Current Day'),
'ending.year' => ts('From 12 Months Ago'),
'ending.quarter' => ts('From 3 Months Ago'),
'ending.month' => ts('From 1 Month Ago'),
'ending.week' => ts('From 1 Week Ago'),
However, the code sets and ending date for the second group & not the first
CRM_Utils_Date ca Line 1100
case 'greater':
$quarter = ceil($now['mon'] / 3);
$from['d'] = 1;
$from['M'] = (3 * $quarter) - 2;
$from['Y'] = $now['year'];
unset($to);
break;
case 'ending':
$to['d'] = $now['mday'];
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
$to['H'] = 23;
$to['i'] = $to['s'] = 59;
$from = self::intervalAdd('month', -3, $to);
$from = self::intervalAdd('second', 1, $from);
break;
}
Which has caused me confusion on report date range. I think the 'ending' & 'greater' words are transposed in the switch statement. Someone wanna check?