-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Multiple Month/Year selection mode not highlighting selected month #4892
Comments
From that code it looks like if multiple selection it will always return Looks like PrimeVue has the same code: https://github.com/primefaces/primevue/blob/fd51e4226e524b59d89ea7c9f08ee5482d84e488/components/lib/calendar/Calendar.vue#L673-L681 PrimeNG is slightly different but still returns So I guess this is intentional? |
It should return true if multipleSelection is true, but it doesn't because its comparing wrong values. If multiple selection is true then the props.value is an array. |
This comment was marked as outdated.
This comment was marked as outdated.
Oh no i see what you mean. They are just sending back false but really it needs to loop over all the dates to see if it is selected. |
My bad I didn't explain it well xD |
Can you paste your exact config here like.. <Calendar value={dates} onChange={(e) => setDates(e.value)} selectionMode="multiple" readOnlyInput /> So I can make mine the same? |
Sure, also here's an example |
Perfect. PR submitted. |
Describe the bug
After taking a brief look, it seems like the
isMonthSelected
function in the calendar component is not functioning as it should:value
is an array of dates when the selectionMode is multiple not a single date. Same could be for Years but I haven't checkedReproducer
No response
PrimeReact version
9.6.2
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Selected months or years should be highlighted.
The text was updated successfully, but these errors were encountered: