Filter date in grid

When I am using filter in grid the filter on date column does't work.

When you select one date shows all or sometimes does not show any

Below it's my code:


html.file:

        <e-column field="creationDate" headerText="Data" textAlign="left" type="date" format="dd.MM.yyyy HH:mm:ss" [filter]='filter'></e-column>

ts. file:

  public filterOption: FilterSettingsModel = { type: 'Excel' };

  public filter: IFilter = {

    params: {

      format: 'dd.MM.yyyy HH:mm:ss'

    }

  };


        this.dataDate= DataUtil.parse.parseJson(this. dataDate );


1 Reply

RS Rajapandiyan Settu Syncfusion Team August 2, 2021 12:48 PM UTC

Hi Lom,  
  
Thanks for contacting Syncfusion support. 

In EJ2 Grid, all the Grid actions like Filtering, Sorting, Grouping, etc., are performed based on the values in the dataSource. If you want to perform Filtering, Sorting on Date column, the values should be DateObject format in its dataSource. Find the below code example and sample for more information. 


[app.component.ts] 

 
export class AppComponent { 
  --- 
 
  ngOnInit(): void { 
    this.data = [ 
      { 
        OrderID: 10248, 
        CustomerID: 'VINET', 
        EmployeeID: 5, 
        OrderDate: new Date('08/02/2021 12:11:45') 
      }, 
      ----- 
    ]; 
  } 
} 
 

    

Still, if you face the same problem, kindly share the below details to validate further. 

  1. Share the full Grid code files (app.component.html & app.component.ts).
  2. Which type of data-binding (local data/ remote data/ custom binding) you have used? Share the adaptors details.
  3. Share the example dataSource and package.json file with us.
  4. Share the video demonstration of the issue.
  5. If possible, share a simple issue reproducible sample or try to make the issue in the given sample.

Regards,  
Rajapandiyan S 


Loader.
Up arrow icon