Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar throws exception when have the onViewDateChange property #2254

Closed
xenouk opened this issue Aug 26, 2021 · 0 comments
Closed

Calendar throws exception when have the onViewDateChange property #2254

xenouk opened this issue Aug 26, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@xenouk
Copy link

xenouk commented Aug 26, 2021

Hi, I cannot use Calendar with the onViewDateChange property. An exception is immediately thrown.

[x] bug report

Current behavior
TypeError: Cannot read property 'getMonth' of null
Calendar.renderDateView
C:/Dev/RE_Project/Frontier-Risk-Web/node_modules/primereact/calendar/calendar.esm.js:3124
3121 | key: "renderDateView",
3122 | value: function renderDateView() {
3123 | var viewDate = this.getViewDate();

3124 | var monthsMetaData = this.createMonths(viewDate.getMonth(), viewDate.getFullYear());
| ^ 3125 | var months = this.renderMonths(monthsMetaData);
3126 | return /#PURE/React.createElement(React.Fragment, null, months);
3127 | }

Expected behavior
No Exception

Minimal reproduction of the problem with instructions
<Calendar onViewDateChange={() => {}} />

  • React version:
    v16.13.1

  • PrimeReact version:
    v6.5.1

  • Browser: [Chrome]

  • Language: [all]

@mertsincan mertsincan self-assigned this Nov 6, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Nov 6, 2021
@mertsincan mertsincan added this to the 7.0.0.Final milestone Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants