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'];