Column sorting issue in date field with dd/MM/YYYY format in angular ig-grid

1.4k Views Asked by At

In igx-grid,

  1. When we apply sorting in ascending and descending order with dd-mm-yyyy format, so sorting is not working with actual date, month and year wise. and only apply date wise sorting.

  2. When we apply sorting in ascending and descending order the date filed it is sorted by yyyy-mm-dd format and we display date in dd/MM/yyyy format on UI using pipe. So sorting is not working in this case.

1

There are 1 best solutions below

0
Konstantin Dinev On

If you haven't applied [dataType]="'date'" to the grid column, then the type defaults to string and column values will be sorted as strings. Add the correct dataType and sorting will work on the dates, regardless of formatting.