-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 UI does not update in some cases #4775
Comments
I am also getting this issue while setting minDate. because set minDate is also checking current month which in case of january is zero. |
In my case, as a temporary solution until this is fixed I added ChangeDetectorRef class detectChanges() method after setting disabledDays property. |
@designus I'm not seeing that adding .detectChanges(); has any effect. If you init your plunker with |
Yes you are right, it is only for the first month of the year. Thanks for the fix. |
Cases are minDate, maxDate, disabledDays and disabledDates |
There is no guarantee in receiving a response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeNG PRO Support where support is provided within 4 business hours
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
http://plnkr.co/edit/okzYh53odGHzV5zOjWgf?p=preview
Current behavior
Calendar UI is not updated when disabledDays input property is changed. Calendar UI is only updated when some event is triggered manually (e.g: click on next month)
Expected behavior
Calendar UI should update whenever input props are changed.
Minimal reproduction of the problem with instructions
Toggle disabledDays on and off and check calendar UI.
Please tell us about your environment:
Same problem occurs in the most recent versions as well. Check plunk link.
Other info
It seems that the problem lies within this line:
https://github.com/primefaces/primeng/blob/master/src/app/components/calendar/calendar.ts#L386
"this.currentMonth" is zero based. So if we are in January, "this.currentMonth" value is 0 which results in condition being false.
The text was updated successfully, but these errors were encountered: