adding-60days-filters
authorjoannechester <j_chester@optusnet.com.au>
Wed, 26 Aug 2015 12:26:43 +0000 (22:26 +1000)
committerjoannechester <j_chester@optusnet.com.au>
Wed, 26 Aug 2015 12:26:43 +0000 (22:26 +1000)
CRM/Core/Form/Date.php
CRM/Utils/Date.php

index e52e2f7d5014c9b5f1976cd833e6d8f9c5bf4492..78d4d8377e833ad73b79e6f2226eb5193160d2a2 100644 (file)
@@ -172,6 +172,7 @@ class CRM_Core_Form_Date {
       'ending_2.year' => ts('Last 2 years including today'),
       'ending.year' => ts('Last 12 months including today'),
       'ending.quarter' => ts('Last 90 days including today'),
+      'ending_2.month' => ts('Last 60 days including today'),
       'ending.month' => ts('Last 30 days including today'),
       'ending.week' => ts('Last 7 days including today'),
       'previous.day' => ts('Yesterday'),
@@ -184,7 +185,8 @@ class CRM_Core_Form_Date {
       'starting.day' => ts('Tomorrow'),
       'starting.week' => ts('Next 7 days including today'),
       'starting.month' => ts('Next 30 days including today'),
-      'starting.quarter' => ts('Next 90 days from today'),
+      'starting_2.month' => ts('Next 60 days including today'),
+      'starting.quarter' => ts('Next 90 days including today'),
       'starting.year' => ts('Next 12 months including today'),
       'less.year' => ts('To end of current calendar year'),
       'less.quarter' => ts('To end of current quarter'),
index 41608d545a37c15b52a2ba86d22665ba0f0f59d0..e018f9611b4c0d93e95ccd297f0fb697fc6c0d15 100644 (file)
@@ -1415,6 +1415,16 @@ class CRM_Utils_Date {
             unset($to);
             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('day', -60, $to);
+            $from = self::intervalAdd('second', 1, $from);
+            break;
+
           case 'ending':
             $to['d'] = $now['mday'];
             $to['M'] = $now['mon'];
@@ -1466,6 +1476,16 @@ class CRM_Utils_Date {
             $to = self::intervalAdd('day', 30, $from);
             $to = self::intervalAdd('second', -1, $to);
             break;
+
+          case 'starting_2':
+            $from['d'] = $now['mday'];
+            $from['M'] = $now['mon'];
+            $from['Y'] = $now['year'];
+            $from['H'] = 00;
+            $from['i'] = $to['s'] = 00;
+            $to = self::intervalAdd('day', 60, $from);
+            $to = self::intervalAdd('second', -1, $to);
+            break;
         }
         break;