Beside existing date presets used when displaying stats:
it would be nice to add new ones like Google Analytics has:
Code:
protected function _getDatePresets()
{
return [
'1day' => ['-1 day', '1_day_ago'],
'1week' => ['-1 week', '1_week_ago'],
'2weeks' => ['-2 weeks', '2_weeks_ago'],
'1month' => ['-1 month', '1_month_ago'],
'3months' => ['-3 months', '3_months_ago'],
'6months' => ['-6 months', '6_months_ago'],
'9months' => ['-9 months', '9_months_ago'],
'1year' => ['-1 year', '1_year_ago'],
'2years' => ['-2 years', '2_years_ago'],
];
}
Code:
<option value="today">Today</option>
<option value="yesterday">Yesterday</option>
<option value="lastweek">Last week</option>
<option value="lastmonth">Last month</option>
<option value="last7days">Last 7 days</option>
<option value="last30days">Last 30 days</option>
Upvote
0