mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis-github.com/angular-calendar/
MIT License
2.71k stars 863 forks source link

Class constructor CalendarDateFormatter cannot be invoked without 'new' #1635

Closed RaviHadalgi closed 1 year ago

RaviHadalgi commented 1 year ago

Package: angular-calendar:0.30.1 angular: 15.0.0

tsconfig: "target": "es5",

I want the target to be in es5.

Using as below (overriding to below format):

@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.

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

Updating target to es6 works fine, but i am constrained from updating to es6.

Please help, how to resolve this issue

matts-bot[bot] commented 1 year ago

This issue has been closed automatically as it did not follow the issue template, please open a new issue that follows the bug report or feature request template.

Thank you! ✌️