[FIXED] primeNg year picker is not showing years

Issue

what I wanted is to setup a simple primeNG calendar with year picker only. So I just implemented it like in the documentation

<p-calendar
  inputId="year"
  [(ngModel)]="date1"
  view="year"
  dateFormat="yy">
</p-calendar>

but surprisingly it just won’t work properly, as you can see here:
primeNG calendar error

Is there anything I’m missing? You can find an example with code here:
https://stackblitz.com/edit/primeng-calendar-demo-thcqfe?file=src%2Fapp%2Fapp.component.html

Solution

You are using primeng version 12.2, which doesnt have year picker in calendar component (https://www.primefaces.org/primeng/v12-lts/#/calendar)

If you want to use year picker in primeng calendar component, you need to update your primeng to version 13+

Answered By – godocmat

Answer Checked By – David Goodson (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published