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

未关闭
#8,468 7 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@Coderxrohan 已经在做这个了。

开始于 2026年1月8日。

评估

这个 Issue 还没有评估数据。

描述

Type: Bug
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.

主要语言
CSS
星标
8.3k
派生
1.2k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

primefaces/primereact 的其他 Issue

查看 primefaces/primereact 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。