Fix last_month logic which breaks in feb

This commit is contained in:
Mike Jolley 2015-03-31 13:12:59 +01:00
parent b603bde738
commit 20850bc742
1 changed files with 4 additions and 3 deletions

View File

@ -489,9 +489,10 @@ class WC_Admin_Report {
break;
case 'last_month' :
$this->start_date = strtotime( date( 'Y-m-01', strtotime( '-1 MONTH', current_time('timestamp') ) ) );
$this->end_date = strtotime( date( 'Y-m-t', strtotime( '-1 MONTH', current_time('timestamp') ) ) );
$this->chart_groupby = 'day';
$first_day_current_month = strtotime( date( 'Y-m-01', current_time( 'timestamp' ) ) );
$this->start_date = strtotime( date( 'Y-m-01', strtotime( '-1 DAY', $first_day_current_month ) ) );
$this->end_date = strtotime( date( 'Y-m-t', strtotime( '-1 DAY', $first_day_current_month ) ) );
$this->chart_groupby = 'day';
break;
case 'month' :