AnsweredAssumed Answered

How to add option to operators, specifically for date type?

Question asked by Cecilia Hanson on Dec 14, 2018
Latest reply on Dec 17, 2018 by Cecilia Hanson

Looking at the file ./clients/base/filters/operators/operators.php the following filter options are available for date type fields:


'date' => array(
'$equals' => 'LBL_OPERATOR_EQUALS',
'yesterday' => 'LBL_OPERATOR_YESTERDAY',
'today' => 'LBL_OPERATOR_TODAY',
'tomorrow' => 'LBL_OPERATOR_TOMORROW',
'last_7_days' => 'LBL_OPERATOR_LAST_7_DAYS',
'next_7_days' => 'LBL_OPERATOR_NEXT_7_DAYS',
'last_30_days' => 'LBL_OPERATOR_LAST_30_DAYS',
'next_30_days' => 'LBL_OPERATOR_NEXT_30_DAYS',
'last_month' => 'LBL_OPERATOR_LAST_MONTH',
'this_month' => 'LBL_OPERATOR_THIS_MONTH',
'next_month' => 'LBL_OPERATOR_NEXT_MONTH',
'last_year' => 'LBL_OPERATOR_LAST_YEAR',
'this_year' => 'LBL_OPERATOR_THIS_YEAR',
'next_year' => 'LBL_OPERATOR_NEXT_YEAR',
'$dateBetween' => 'LBL_OPERATOR_BETWEEN',


Is there a way to override these options to include "this_week" and "last_week". 


Alternatively, can someone point me in the direction of how the logic for "last_month" and "this_month" is handled? Then I could extrapolate a solution from there. 


Currently using SugarCRM Enterprise 7.9.4 on prem


Thank you!