Skip to content

Pivot Grid: Date field not auto-detected or parsed when provided as timestamp or string value #16366

@zdrawku

Description

@zdrawku

Description:

When using the Pivot Grid with autoGenerateConfig: true, date fields represented as timestamps (e.g., 1577829600000) or string values (e.g., "2008-06-20", "10/24/2025") are not recognized as Date objects during initialization.

As a result, the autoGenerateConfig logic does not create an IgxPivotDateDimension for such fields, and they are not automatically assigned as Row Dimensions as specified in the component’s behavior spec

Expected Behavior

  • Fields containing timestamps or valid date strings should be parsed into Date objects on initialization.

  • The Pivot Grid should auto-resolve them as IgxPivotDateDimension and enable them by default in the Row Dimensions collection.

  • Example:

    [
      { Date: 1577829600000, Sales: 100 },
      { Date: "2008-06-20", Sales: 200 }
    ]

    Should produce a Row Dimension for Date, grouped as:
    All Periods > 2008 > June > Fri Jun 20 2008

Current Behavior

  • Timestamp or string date values remain unparsed and are treated as plain numeric or string fields.
  • The Date field is skipped during auto-configuration.
  • When manually selecting and dragging the Date field in the Pivot Configurator, some transformation occurs — the values are displayed and grouped, but not as a proper Date hierarchy (e.g., shown as "2008-06-20" instead of grouped by period: All Periods → 2008 → June → Fri Jun 20 2008). This is probabbly another bug and possible improvement of the existing logic that handles the parsing upon dropping a field for Row Dimension.
Image

Proposed Fix

Enhance the Pivot Grid’s auto-generation logic to:

  • Detect and parse date-like strings and numeric timestamps into Date objects.
  • Automatically resolve them as IgxPivotDateDimension during configuration generation.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions