Skip to content
Snippets Groups Projects
Commit e2c3163d authored by monishdeb's avatar monishdeb
Browse files

CRM-12520 fixes

----------------------------------------
* CRM-12520: Add 24 and 36 month searching to relative date filter drop downs
  http://issues.civicrm.org/jira/browse/CRM-12520
parent 8741f15f
No related branches found
No related tags found
No related merge requests found
......@@ -171,6 +171,8 @@ Class CRM_Core_Form_Date {
'current.quarter' => ts('Current Quarter to-date'),
'current.month' => ts('Current Month to-date'),
'current.week' => ts('Current Week to-date'),
'ending_3.year' => ts('Last 3 Years'),
'ending_2.year' => ts('Last 2 Years'),
'ending.year' => ts('Last 12 Months'),
'ending.quarter' => ts('Last 3 Months'),
'ending.month' => ts('Last Month'),
......
......@@ -984,6 +984,26 @@ class CRM_Utils_Date {
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
break;
case 'ending_2':
$to['d'] = $now['mday'];
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
$to['H'] = 23;
$to['i'] = $to['s'] = 59;
$from = self::intervalAdd('year', -2, $to);
$from = self::intervalAdd('second', 1, $from);
break;
case 'ending_3':
$to['d'] = $now['mday'];
$to['M'] = $now['mon'];
$to['Y'] = $now['year'];
$to['H'] = 23;
$to['i'] = $to['s'] = 59;
$from = self::intervalAdd('year', -3, $to);
$from = self::intervalAdd('second', 1, $from);
break;
}
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment