+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
* format is 2007-12-21 )
*
* @return string
- * Return the customized todays date (Y-m-d)
+ * Return the customized today's date (Y-m-d)
*/
public static function getToday($dayParams = NULL, $format = "Y-m-d") {
if (is_null($dayParams) || empty($dayParams)) {
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'];
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'];
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'];
$to['Y'] = $now['year'];
$to['H'] = 23;
$to['i'] = $to['s'] = 59;
- $from = self::intervalAdd('month', -1, $to);
+ $from = self::intervalAdd('day', -30, $to);
$from = self::intervalAdd('second', 1, $from);
break;