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

p-calendar months not disabled in month selection mode #11339

Closed
randes73 opened this issue Mar 25, 2022 · 4 comments
Closed

p-calendar months not disabled in month selection mode #11339

randes73 opened this issue Mar 25, 2022 · 4 comments
Assignees
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team

Comments

@randes73
Copy link

If you have a PrimeNG PRO Support subscription please post your issue at;

https://pro.primefaces.org

where our team will respond within 4 business hours.

If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that
your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.

Current Queue Time for Review
Without PRO Support: ~8-12 weeks.
With PRO Support: 1 hour

I'm submitting a ... (check one with "x")

[X ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/github/primefaces/primeng-issue-template

Current behavior

p-calendar no longer disables months in month selector when view attribute is set to month after version 13.1.0 related to
commit: bbd97fd
issue: #11027

While I understand the reason for the change when p-calendar is in normal date selection mode (view=date), we feel like the recent change causes a bug when date selection mode is month. We have a business case in which we only select a month using p-calendar and also use min/max as well as disabled dates. We may have some months between min/max that have no underlying data and do not allow the user to select those months.

Expected behavior

Continue to disable months in the month selector when view mode is set to month supporting min/max dates as well as disabled dates. Please see attached picture of how the month selection appears in version 13.0.4 and prior. Here is an example where we have min date of Jun 2018, max date of Sep 2018 along with Jul/Aug 2018 (between min/max) disabled because we have no underlying data for those months.
image

Minimal reproduction of the problem with instructions

p-calendar with
view=month
minDate=set to a minimum date
maxDate=set to a maximum date
disabledDates=set to one or more dates in between min/max date

What is the motivation / use case for changing the behavior?

to restore previous behavior prior to bbd97fd. As noted above, the previous behavior was expected behavior for our business needs when view=month.

Please tell us about your environment:

Windows, VS Code, npm, IIS, node

  • Angular version: 5.X

Angular 13.2.6

  • PrimeNG version: 5.X

13.2.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

latest Chrome & Edge

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript ~4.5.5

  • Node (for AoT issues): node --version =
    node=16.13.2
    npm=8.4.1

@nandowalter
Copy link

We are experiencing the same situation in our website. No more able to disable some specific months in "month" view mode. Please consider to make available again this feature.

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Mar 31, 2022
@yigitfindikli yigitfindikli added this to the 13.3.3 milestone Mar 31, 2022
@yigitfindikli yigitfindikli modified the milestones: 13.3.3, 13.Future Apr 13, 2022
@LeaoSomogyi
Copy link

Same issue here, version 13.4.1 using angular 13.3.1. This happens on version 13.3.1 too. None fix released since April? =/

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

@randes73
Copy link
Author

randes73 commented Nov 9, 2022

Thank you for the response. We ended up going with another control because this was a blocking issue for us. I did however take a look at the latest source (https://github.com/primefaces/primeng/blob/master/src/app/components/calendar/calendar.ts) and it does appear like this issue was taken care of but I have not tested/verified. I can now see that the following lines have been added in the template when looping through monthPickerValues:
[ngClass]="{ 'p-highlight': isMonthSelected(i), 'p-disabled': isMonthDisabled(i) }

Thanks again.

@mertsincan mertsincan removed this from the 14.Future milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

No branches or pull requests

6 participants