primefaces / primefaces/primereact

[v11] Datepicker: Error when trying to select the year after selecting a date in range mode.

Open
#8,468 7 comments 0 reactions 1 assignee View on GitHub

@Coderxrohan is already working on this.

Since Jan 8, 2026.

Type: Bug
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

The bug is currently reproduceable on your own docs.

Having a date in selected in range mode in the datepicker and clicking on the years throws a typeError:

This is the error stack:

Error caught by Error Boundary: TypeError: s7.getFullYear is not a function
At useDatePicker.ts:289
year DatePicker.style.ts:174
m resolve.ts:4
F2 getKeyValue.ts:13
D useComponentStyle.ts:118
hr DatePickerTableBodyCell.tsx:82
render DatePickerTableBodyCell.tsx:97
React 18
Vt useDatePicker.ts:554
React 26
performWorkUntilDeadline scheduler.development.js:45
js scheduler.development.js:223
js scheduler.development.js:364
__require2 chunk-PLDDJCW6.js:17
js index.js:6
__require2 chunk-PLDDJCW6.js:17
React 2
__require2 chunk-PLDDJCW6.js:17
js React
__require2 chunk-PLDDJCW6.js:17
react-dom_client.js:20192

Reproducer

No response

System Information
It is reproduceable on your own docs.
Steps to reproduce the behavior
  1. Open https://v11.primereact.org/docs/components/datepicker on the Range Example
Image
  1. Select two dates
Image
  1. Click the year
Image
  1. After the click the page breaks
Image
Expected behavior

The page doesn't break and it shows the year picker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.