@@ -2083,7 +2083,7 @@ describe('IgxPivotGrid #pivotGrid', () => {
20832083 expect ( pivotGrid . values . map ( x => x . enabled ) ) . toEqual ( [ true , true ] ) ;
20842084 } ) ;
20852085
2086- it ( 'should auto-generate pivot config and parse date fields from timestamp values' , ( ) => {
2086+ it ( 'should auto-generate pivot config and detect date fields from timestamp values' , ( ) => {
20872087 const pivotGrid = fixture . componentInstance . pivotGrid ;
20882088 pivotGrid . pivotConfiguration = undefined ;
20892089 pivotGrid . autoGenerateConfig = true ;
@@ -2105,27 +2105,28 @@ describe('IgxPivotGrid #pivotGrid', () => {
21052105 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . memberName ) ) . toEqual ( [ 'AllPeriods' ] ) ;
21062106 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . enabled ) ) . toEqual ( [ true ] ) ;
21072107
2108- // Verify the timestamp was converted to a Date object
2109- expect ( pivotGrid . data [ 0 ] . Date instanceof Date ) . toBe ( true ) ;
2110- expect ( pivotGrid . data [ 0 ] . Date . getTime ( ) ) . toBe ( TEST_TIMESTAMP ) ;
2108+ // Verify the timestamp is still in its original format (not pre-parsed)
2109+ // IgxPivotDateDimension will handle parsing on-demand
2110+ expect ( pivotGrid . data [ 0 ] . Date ) . toBe ( TEST_TIMESTAMP ) ;
21112111
21122112 // values should be UnitPrice and UnitsSold (not Date)
21132113 expect ( pivotGrid . values . length ) . toEqual ( 2 ) ;
21142114 expect ( pivotGrid . values . map ( x => x . member ) ) . toEqual ( [ 'UnitPrice' , 'UnitsSold' ] ) ;
21152115 } ) ;
21162116
2117- it ( 'should auto-generate pivot config and parse date fields from ISO date strings' , ( ) => {
2117+ it ( 'should auto-generate pivot config and detect date fields from ISO date strings' , ( ) => {
21182118 const pivotGrid = fixture . componentInstance . pivotGrid ;
21192119 pivotGrid . pivotConfiguration = undefined ;
21202120 pivotGrid . autoGenerateConfig = true ;
21212121
21222122 // Test with ISO date string
2123+ const TEST_DATE_STRING = '2008-06-20' ;
21232124 pivotGrid . data = [ {
21242125 ProductCategory : 'Clothing' ,
21252126 UnitPrice : 12.81 ,
21262127 SellerName : 'Stanley' ,
21272128 Country : 'Bulgaria' ,
2128- Date : '2008-06-20' ,
2129+ Date : TEST_DATE_STRING ,
21292130 UnitsSold : 282
21302131 } ] ;
21312132 fixture . detectChanges ( ) ;
@@ -2135,25 +2136,24 @@ describe('IgxPivotGrid #pivotGrid', () => {
21352136 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . memberName ) ) . toEqual ( [ 'AllPeriods' ] ) ;
21362137 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . enabled ) ) . toEqual ( [ true ] ) ;
21372138
2138- // Verify the date string was converted to a Date object
2139- expect ( pivotGrid . data [ 0 ] . Date instanceof Date ) . toBe ( true ) ;
2140- expect ( pivotGrid . data [ 0 ] . Date . getFullYear ( ) ) . toBe ( 2008 ) ;
2141- expect ( pivotGrid . data [ 0 ] . Date . getMonth ( ) ) . toBe ( 5 ) ; // June is month 5 (0-indexed)
2142- expect ( pivotGrid . data [ 0 ] . Date . getDate ( ) ) . toBe ( 20 ) ;
2139+ // Verify the date string is still in its original format (not pre-parsed)
2140+ // IgxPivotDateDimension will handle parsing on-demand
2141+ expect ( pivotGrid . data [ 0 ] . Date ) . toBe ( TEST_DATE_STRING ) ;
21432142 } ) ;
21442143
2145- it ( 'should auto-generate pivot config and parse date fields from US format date strings' , ( ) => {
2144+ it ( 'should auto-generate pivot config and detect date fields from US format date strings' , ( ) => {
21462145 const pivotGrid = fixture . componentInstance . pivotGrid ;
21472146 pivotGrid . pivotConfiguration = undefined ;
21482147 pivotGrid . autoGenerateConfig = true ;
21492148
21502149 // Test with US format date string (MM/DD/YYYY)
2150+ const TEST_US_DATE_STRING = '10/24/2025' ;
21512151 pivotGrid . data = [ {
21522152 ProductCategory : 'Clothing' ,
21532153 UnitPrice : 12.81 ,
21542154 SellerName : 'Stanley' ,
21552155 Country : 'Bulgaria' ,
2156- Date : '10/24/2025' ,
2156+ Date : TEST_US_DATE_STRING ,
21572157 UnitsSold : 282
21582158 } ] ;
21592159 fixture . detectChanges ( ) ;
@@ -2163,11 +2163,9 @@ describe('IgxPivotGrid #pivotGrid', () => {
21632163 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . memberName ) ) . toEqual ( [ 'AllPeriods' ] ) ;
21642164 expect ( pivotGrid . pivotConfiguration . rows . map ( x => x . enabled ) ) . toEqual ( [ true ] ) ;
21652165
2166- // Verify the date string was converted to a Date object
2167- expect ( pivotGrid . data [ 0 ] . Date instanceof Date ) . toBe ( true ) ;
2168- expect ( pivotGrid . data [ 0 ] . Date . getFullYear ( ) ) . toBe ( 2025 ) ;
2169- expect ( pivotGrid . data [ 0 ] . Date . getMonth ( ) ) . toBe ( 9 ) ; // October is month 9 (0-indexed)
2170- expect ( pivotGrid . data [ 0 ] . Date . getDate ( ) ) . toBe ( 24 ) ;
2166+ // Verify the date string is still in its original format (not pre-parsed)
2167+ // IgxPivotDateDimension will handle parsing on-demand
2168+ expect ( pivotGrid . data [ 0 ] . Date ) . toBe ( TEST_US_DATE_STRING ) ;
21712169 } ) ;
21722170
21732171 it ( 'should handle multiple date fields and enable only the first one' , ( ) => {
@@ -2196,9 +2194,10 @@ describe('IgxPivotGrid #pivotGrid', () => {
21962194 expect ( rowDimensions [ 0 ] . enabled ) . toBe ( true ) ;
21972195 expect ( rowDimensions [ 1 ] . enabled ) . toBe ( false ) ;
21982196
2199- // Verify both date values were parsed
2200- expect ( pivotGrid . data [ 0 ] . StartDate instanceof Date ) . toBe ( true ) ;
2201- expect ( pivotGrid . data [ 0 ] . EndDate instanceof Date ) . toBe ( true ) ;
2197+ // Verify date values remain in their original format (not pre-parsed)
2198+ // IgxPivotDateDimension will handle parsing on-demand
2199+ expect ( pivotGrid . data [ 0 ] . StartDate ) . toBe ( TEST_START_TIMESTAMP ) ;
2200+ expect ( pivotGrid . data [ 0 ] . EndDate ) . toBe ( TEST_END_DATE_STRING ) ;
22022201 } ) ;
22032202
22042203 it ( 'should not treat regular numbers as timestamps' , ( ) => {
0 commit comments