Home > OS >  PrimeNG p-calendar month picker not working
PrimeNG p-calendar month picker not working

Time:02-01

I have copied code from PrimeNG for month picker. And it's work great but for some reason it's not working like on the PrimeNG example - the year stays the same when clicking on arrows buttons. But ngModel is changing properly. Visualization

<div >
  <div >
    <label for="monthpicker">Month Picker</label>
    <p-calendar
      [(ngModel)]="date12"
      view="month"
      dateFormat="mm/yy"
      [yearNavigator]="true"
      yearRange="2000:2030"
      [readonlyInput]="true"
      inputId="monthpicker"
    ></p-calendar>
  </div>
</div>

CodePudding user response:

HERE your own code working fine:

It's a well-known bug: https://github.com/primefaces/primeng/issues/11038

It has been fixed in primeng 13.0.5 ( 19 days ago). You would have to update your primNg in order to fix it (try with latest: PrimeNG 13.1.0).

NOTE: "yearRange", "yearNavigator" are deprecated.

  •  Tags:  
  • Related