Skip to content

Grid Grouping ISO Dates displays the wrong value #15181

@pmoleri

Description

@pmoleri

Description

Grid Grouping ISO Dates displays the wrong date

  • igniteui-angular version: 18.2.8
  • browser: Any

Steps to reproduce

  1. Add a grid
  2. Set to data with dates as date-only ISO strings e.g. '2016-11-23'
  3. Set the date column as group-able [groupable]="true"
  4. Use a custom template to format the date as 'shortDate':
    <igx-column field="OrderDate" header="Order Date" width="200px" [groupable]="true" dataType="date"> <ng-template igxCell let-value> {{ value | date:'shortDate' }} </ng-template> </igx-column> 
  5. Set your machine timezone to any negative GMT
  6. Try grouping by that column

Result

The group Date is wrong, expanding the group shows the correct date in the rows.
e.g. 2016-11-23 gets grouped as 2016-11-22

Expected result

The group Date to be the same as the rows that it groups.

Attachments

image

Repro stackblitz: https://stackblitz.com/edit/mt2zmdk2?file=src%2Fapp%2Fdata%2FinvoiceData.ts,src%2Fapp%2Fgrid%2Fgrid-groupby-custom-sample%2Fgrid-groupby-custom-sample.component.html

Reported on Discord: https://discord.com/channels/836634487483269200/1318663487223763076

See explanation on Angular's code about how to convert date strings:
https://github.com/angular/angular/blob/4a8d0b79001ec09bcd6f2d6b15117aa6aac1932c/packages/common/src/i18n/format_date.ts#L915C1-L921C65

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions