angular-calendar icon indicating copy to clipboard operation
angular-calendar copied to clipboard

Class constructor CalendarDateFormatter cannot be invoked without 'new' in Angular v15+ with es5 as target in tsconfig.

Open RaviHadalgi opened this issue 3 years ago • 1 comments

Describe the bug

Class constructor CalendarDateFormatter cannot be invoked without 'new' in angular 15 version, working in earlier version of angular.

tsconfig:
"target": "es5", I want the target to be in es5.

Used as below: @Injectable() export class CustomDateFormatter extends CalendarDateFormatter { public monthViewColumnHeader({ date, locale }: DateFormatterParams): string { return formatDate(date, 'EEEEEE', locale); 
 }
 }

as defined in node_modules/angular-calendar/modules/common/calendar-date-formatter.provider.d.ts.

Defined in component selector: 'app-calendar-view',
 templateUrl: './calendar-view.component.html', 
styleUrls: ['./calendar-view.component.scss'],
 providers: [
 { 
provide: CalendarDateFormatter, 
useClass: CustomDateFormatter},
 ], 
} )

Minimal reproduction of the problem with instructions

Screenshots image

Versions

  • @angular/core: 15.0.0
  • angular-calendar: :0.30.1
 or above
  • Browser name and version: Chrome, Firefox and Edge.

Updating target to es6 works fine, but i am constrained from updating to es6. Please help, on how to run the calendar with Ang15+ version having target set to es5.

RaviHadalgi avatar Jan 09 '23 14:01 RaviHadalgi

Thanks so much for opening an issue! If you'd like to support this project, then please consider sponsoring me

matts-bot[bot] avatar Jan 09 '23 14:01 matts-bot[bot]