Reduce the number of filter operators for Date Time

I'm trying to limit the number of available filters on the filter menu to just include greater/less than or equal to.

When using  dateOperator in the filter settings it isn't used when the value is a date time.


Example: Order Date isn't set using dateOperator settings.

https://stackblitz.com/edit/angular-ivcfg1?file=app.component.ts


Thanks

Michael


1 Reply

RS Rajapandiyan Settu Syncfusion Team September 8, 2021 06:33 AM UTC

Hi Michael, 
 
Thanks for contacting Syncfusion support. 
 
We have validated the provided sample and we suggest binding the custom data operator in the filterMenu by using ‘datetimeOperator’ (for date time) property in filterSettings. Please find the code example for your reference. 
 
  this.filterSettings = { 
      type: 'Menu', 
      operators: { 
        datetimeOperator: [{ value: 'greaterThan'text: 'greater than' }] 
      } 
    }; 
 
 
You can customize the default filter operator list by defining the filterSettings.operators property. The available options are: 
 
  • stringOperator- defines customized string operator list.
  • numberOperator - defines customized number operator list.
  • dateOperator - defines customized date operator list.
  • datetimeOperator – defines customized date time operator list.
  • booleanOperator - defines customized boolean operator list.
 
 
 
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Loader.
Up arrow icon