Skip to content

Commit

Permalink
Issue #4778 - Additional date-filter options added.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed May 22, 2022
1 parent 31389dc commit 6f34dc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 11 additions & 3 deletions e107_handlers/admin_ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -3916,6 +3916,10 @@ protected function _parseFilterRequest($filter_value)
'hour' => '1 hour ago',
'day' => '24 hours ago',
'week' => '1 week ago',
'today' => 'today midnight',
'thisweek' => 'monday this week midnight',
'thismonth' => 'first day of this month midnight',
'thisyear' => 'first day of January midnight',
'month' => '1 month ago',
'month3' => '3 months ago',
'month6' => '6 months ago',
Expand All @@ -3934,9 +3938,9 @@ protected function _parseFilterRequest($filter_value)
$ky = $filter[2];
$time = vartrue($dateConvert[$ky]);
$timeStamp = strtotime($time);

$res = array($filter[1], $timeStamp);

$res = array($filter[1], $timeStamp);
// e107::getMessage()->addDebug('Date: '.date('c', $timeStamp));
$this->_log('listQry Filtered by ' .$filter[1]. ' (' .$time. ')');

break;
Expand Down Expand Up @@ -8325,7 +8329,11 @@ public function renderBatchFilter($type='batch', $selected = '') // Common funct
'month3' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,3),
'month6' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,6),
'month9' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,9),
'year' => LAN_UI_FILTER_PAST_YEAR
'year' => LAN_UI_FILTER_PAST_YEAR,
'today' => LAN_UI_FILTER_TODAY,
'thisweek' => LAN_UI_FILTER_THIS_WEEK,
'thismonth' => LAN_UI_FILTER_THIS_MONTH,
'thisyear' => LAN_UI_FILTER_THIS_YEAR,
);

$dateFiltersFuture = array (
Expand Down
5 changes: 5 additions & 0 deletions e107_languages/English/admin/lan_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,3 +589,8 @@

define("LAN_NO_SCRIPT_ACCESS", "You don't have permission to use [script] tags.");
define("LAN_NO_SCRIPT_ACCESS_ASK", "If you believe this is an error, please ask the main administrator to grant you script access via [b]Preferences > Content Filters[/b]");

define("LAN_UI_FILTER_TODAY", "Today");
define("LAN_UI_FILTER_THIS_WEEK", "This Week");
define("LAN_UI_FILTER_THIS_MONTH", "This Month");
define("LAN_UI_FILTER_THIS_YEAR", "This Year");

0 comments on commit 6f34dc9

Please sign in to comment.