Skip to content

Pivot grid date dimension values are not localized #16442

@mddragnev

Description

@mddragnev

Description

Testing with #16034
Changing the locale in pivot grid does not update the date values, which is not consistent with other grids.
I think that we should update the values when the provided with IgxPivotDateDimension.
However, some might argue that using memberFunction makes it possible to format the values as the user wants.

  • igniteui-angular version:
  • browser:

Steps to reproduce

  1. Open pivot hierarchy dev sample
  2. Update the config:
public pivotConfigHierarchy: IPivotConfiguration = {
        columns: [
            {
                memberName: 'City',
                memberFunction: (data) => data.Seller.City,
                enabled: true,
            },
        ],
        rows: [
            new IgxPivotDateDimension({ memberName: 'Date', enabled: true }),
        ],
        values: [
            {
                member: 'NumberOfUnits',
                aggregate: {
                    aggregator: IgxPivotNumericAggregate.sum,
                    key: 'sum',
                    label: 'Sum'
                },
                enabled: true

            }, {
                member: 'Value',
                aggregate: {
                    aggregator: IgxPivotNumericAggregate.sum,
                    key: 'sum',
                    label: 'Sum'
                },
                enabled: true,
                formatter: (val) => val ? parseFloat(val).toFixed(2) : undefined
            }
        ],
        filters: null
    };

Result

The values are rendered as they are exactly in the data.
Image

Expected result

Since we might not expose a pipeArgs formatter, we might want to format the dates to lets say shortDate when using IgxPivotDateDimension which shortDate would change based on the provided locale. However, me might want to let the user format the values when he is not using the IgxPivotDateDimension

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions