You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IgxDateFormatterPipe throws TypeError: Cannot read properties of undefined (reading 'length') when format is undefined after Angular 22.1 upgrade #17493
After upgrading to Angular 22.1, BaseFormatter.formatDate() throws a TypeError when the format argument is undefined (i.e. not provided by the caller). This is a regression caused by a new validation call (assertValidDateFormatLength) introduced in Angular 22.1's formatDate().
functionassertValidDateFormatLength(format: string){if(format.length>MAX_DATE_FORMAT_LENGTH){//.length throws an errorthrownewRuntimeError(RuntimeErrorCode.SUSPICIOUS_DATE_FORMAT,ngDevMode&&`Date format is too long. Exceeded maximum length of ${MAX_DATE_FORMAT_LENGTH} characters.`,);}}
Date/Time/DateTime: Use default locale format as inputFormat when editorOptions/pipeArgs formats are null/empty and Should not throw error when entities are empty and expressionTree is set. will throw TypeError: Cannot read properties of undefined (reading 'length')
Description
Summary
After upgrading to Angular 22.1,
BaseFormatter.formatDate()throws aTypeErrorwhen theformatargument isundefined(i.e. not provided by the caller). This is a regression caused by a new validation call (assertValidDateFormatLength) introduced in Angular 22.1'sformatDate().https://github.com/angular/angular/blame/main/packages/common/src/i18n/format_date.ts#L138
Angular Version
Broken in:
22.1.0Works in:
22.0.xIgnite UI for Angular Version
22.0
Steps to Reproduce
Date/Time/DateTime: Use default locale format as inputFormat when editorOptions/pipeArgs formats are null/emptyandShould not throw error when entities are empty and expressionTree is set.will throwTypeError: Cannot read properties of undefined (reading 'length')