Skip to content

Commit

Permalink
fix: correct month calculation logic to handle month, year transition…
Browse files Browse the repository at this point in the history
… properly (#17238)
  • Loading branch information
qwadrox authored Jan 15, 2025
1 parent 0cc39d9 commit 593c518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/primeng/src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1471,8 +1471,8 @@ export class DatePicker extends BaseComponent implements OnInit, AfterContentIni
let m = month + i;
let y = year;
if (m > 11) {
m = (m % 11) - 1;
y = year + 1;
m = m % 12;
y = year + Math.floor((month + i) / 12);
}

this.months.push(this.createMonth(m, y));
Expand Down

0 comments on commit 593c518

Please sign in to comment.