1

Im trying to implement mattlewis92's angular calendar (https://github.com/mattlewis92/angular-calendar) and I can't figure out what i need to inclide to have a working header component.

Problems:

<h3>{{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}</h3>
this.dateFormatter[method] is not a function

but it works when:

<h3>{{ viewDate | calendarDate:('dayViewTitle'):'en' }}</h3>

other:

TypeError: addFn is not a function
at CalendarNextViewDirective.onClick (calendar-next-view.directive.js:33)

same with previus date.

Has anyone suggestion?

  • What is `view` in `calendarDate:(view + 'ViewTitle')`? Is it a string property or variable of the component class? – ConnorsFan Jan 01 '18 at 14:31
  • A string property. values are: 'month', 'week', 'day'. It should concat the two strings and should give 'dayViewTitle'. whenn its hardcoded ti has no problem. Whenn its like so it's unable to resolbe the angular pipe. – Fülöp Kóta Jan 01 '18 at 15:11
  • Can you show in the question the code for the `view` property? – ConnorsFan Jan 01 '18 at 15:21
  • ```private _view: string; public get view(){ return this._view; } public set view(view:string){ this._view = view; } ``` – Fülöp Kóta Jan 01 '18 at 15:38
  • If you try: `public get view(): string { return 'day'; }`, does it work? – ConnorsFan Jan 01 '18 at 15:46
  • Great. thanks. It does the job but it still undescored with red line(VS Code). – Fülöp Kóta Jan 02 '18 at 14:53
  • I'm having exactly the same issue `TypeError: this.dateFormatter[method] is not a function` Have you found a solution for this in the mean time? – candide Mar 28 '18 at 20:51
  • I am also using mattlewis92's angular calendar. it is showing full month name and full day name. i need to show short name of month and days like (Su, Mo, Tu) etc. I do not know how to format this. Can you please help? @ConnorsFan – Gobind Gupta Aug 20 '20 at 12:45

0 Answers0