From 5eb3092fa1dfde75bfe39eae9bbe83d6ba4933ed Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 19 Mar 2015 18:19:35 -0700 Subject: [PATCH] CRM-16146 - fix typo and incorrect date range calc for Fiscal Year ranges. ---------------------------------------- * CRM-16146: Fiscal year filters have typos and (slightly) incorrect date ranges https://issues.civicrm.org/jira/browse/CRM-16146 --- CRM/Utils/Date.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index 582a7f6d0e..726d79c32d 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -1098,7 +1098,7 @@ class CRM_Utils_Date { switch ($relativeTerm) { case 'this': $from['Y'] = $fYear; - $fiscalYear = mktime(0, 0, 0, $from['M'], $form['d'], $from['Y'] + 1); + $fiscalYear = mktime(0, 0, 0, $from['M'], $from['d'] - 1, $from['Y'] + 1); $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear)); $to['d'] = $fiscalEnd['2']; @@ -1108,7 +1108,7 @@ class CRM_Utils_Date { case 'previous': $from['Y'] = $fYear - 1; - $fiscalYear = mktime(0, 0, 0, $from['M'], $form['d'], $from['Y'] + 1); + $fiscalYear = mktime(0, 0, 0, $from['M'], $from['d'] - 1, $from['Y'] + 1); $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear)); $to['d'] = $fiscalEnd['2']; $to['M'] = $fiscalEnd['1']; @@ -1117,7 +1117,7 @@ class CRM_Utils_Date { case 'next': $from['Y'] = $fYear + 1; - $fiscalYear = mktime(0, 0, 0, $from['M'], $from['d'], $from['Y'] + 1); + $fiscalYear = mktime(0, 0, 0, $from['M'], $from['d'] - 1, $from['Y'] + 1); $fiscalEnd = explode('-', date("Y-m-d", $fiscalYear)); $to['d'] = $fiscalEnd['2']; $to['M'] = $fiscalEnd['1']; -- 2.25.1