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: Multiple Month/Year selection mode not highlighting selected month #4418

Closed
melloware opened this issue Sep 9, 2023 · 0 comments · Fixed by #4419
Closed

Calendar: Multiple Month/Year selection mode not highlighting selected month #4418

melloware opened this issue Sep 9, 2023 · 0 comments · Fixed by #4419
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@melloware
Copy link
Member

Describe the bug

Original Report on PrimeReact: primefaces/primereact#4892

After taking a brief look, it seems like the isMonthSelected function in the calendar component is not functioning as it should:

       const isMonthSelected = (month) => {
            if (isComparable()) {
                let value = isRangeSelection() ? props.value[0] : props.value;
                return !isMultipleSelection() ? value.getMonth() === month && value.getFullYear() === currentYear : false;
            }
            return false;
        };

value is an array of dates when the selectionMode is multiple not a single date. Same could be for Years but I haven't checked

Reproducer

xx

PrimeVue version

Latest

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

Alll

Steps to reproduce the behavior

<Calendar value={date} selectionMode="multiple" onChange={(e) => setDate(e.value)} view="month" dateFormat="mm/yy"  readOnlyInput  />

Does not highlight months same for year

Expected behavior

Should highlight months and years.

@melloware melloware added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 9, 2023
melloware added a commit to melloware/primevue that referenced this issue Sep 9, 2023
@mertsincan mertsincan added this to the 3.35.1 milestone Oct 5, 2023
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants