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

Primevue DatePicker DisabledDates doesn't work when in monthly view mode #7270

Open
1 of 4 tasks
barrierwill opened this issue Feb 17, 2025 · 2 comments
Open
1 of 4 tasks
Labels
Resolution: Needs Upvote 👍 Support this idea or feature by adding an upvote. Community feedback helps with prioritization. Type: New Feature Issue contains a new feature or new component request

Comments

@barrierwill
Copy link

Describe the bug

When using the primevue datepicker in monthly view mode, I want certain months to not be able to be selected. Using the disabledDates prop does nothing for disabling invalid months by the calendar popup and the user can still select invalid dates for the month picker.

It is inconsistent because the user is blocked from typing in an invalid date, but not for selecting the date in the calendar popup.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/3mrnf6a8?file=src%2FApp.vue

Environment

Its just the environment made from copying one of the date picker stack blitz pages.

Vue version

3.2.45

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the calendar.
  2. Select February
  3. February is filled in as 02/01/2025 even though every day in February is not allowed to be selected.

Expected behavior

I expect the month of February to be disabled because of 2 reasons:

  1. Every day in February is disabled, so the calendar selection for February should be disabled.
  2. Since the value when clicking on February in the calendar is 02/01/2025, I expect just having the first date of the month being in the disabledDates array will disable the whole month.

Also, if the user manually types in '02/01/2025', it gets cleared out as expected. The user can still choose the date in the datepicker by opening the calendar popup.

If you get rid of the 'view=month' prop on the datepicker, you can see that every date in February is disabled so the user can't choose any date in February at all. With the 'view=month' prop, it doesn't work the same way.

@barrierwill barrierwill added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 17, 2025
@tugcekucukoglu tugcekucukoglu added Type: New Feature Issue contains a new feature or new component request Resolution: Needs Upvote 👍 Support this idea or feature by adding an upvote. Community feedback helps with prioritization. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 21, 2025
Copy link

Thanks a lot for this issue! PrimeTek's own vision for PrimeVue is demanding, but community feedback is crucial in prioritization. The more upvotes help ensure this fix can be addressed quickly or the related PR can be merged soon.

@YannisJustine
Copy link
Contributor

I completely agree with this request. I previously brought up this point in this discussion. I hope this can be considered soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs Upvote 👍 Support this idea or feature by adding an upvote. Community feedback helps with prioritization. Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

3 participants