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

matDatepickerFilter calls filter function even if the date is not withing min and max inputs #18411

Closed
chandrasagarjain opened this issue Feb 6, 2020 · 2 comments · Fixed by #18419, lingounet/testage#9, hrueger/AGLight#112 or hrueger/AGLight#114
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@chandrasagarjain
Copy link

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-mat-datepicker-jajkwy

Steps to reproduce:

  1. Click on date viewer
  2. Check the console

Expected Behavior

What behavior were you expecting to see?
That matDatepickerFilter function is not called if the date in calender is not within min and max values

Actual Behavior

What behavior did you actually see?
matDatepickerFilter function is called for all dates

Environment

  • Angular: (8.3.8)
  • CDK/Material:8.1.2
  • Browser(s):Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@mimedo
Copy link

mimedo commented Feb 6, 2020

Based on the documentation you use either min/max or matDatepickerFilter validation, and not combined.
Because you don't have any validation implemented in your myFilter function, it will output you for any date in console.
To find the solution to your initial idea, can you please explain in more detail?

@crisbeto crisbeto self-assigned this Feb 6, 2020
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Feb 6, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Feb 6, 2020
…unds

Doesn't call the `dateFilter` function for date is before the minimum or after the maximum in the month view. We were already doing this for the rest of the views, but I added some tests so we have coverage for it.

Fixes angular#18411.
mmalerba pushed a commit that referenced this issue Feb 7, 2020
…unds

Doesn't call the `dateFilter` function for date is before the minimum or after the maximum in the month view. We were already doing this for the rest of the views, but I added some tests so we have coverage for it.

Fixes #18411.
andrewseguin pushed a commit that referenced this issue Feb 20, 2020
…unds (#18419)

Doesn't call the `dateFilter` function for date is before the minimum or after the maximum in the month view. We were already doing this for the rest of the views, but I added some tests so we have coverage for it.

Fixes #18411.
andrewseguin pushed a commit that referenced this issue Feb 20, 2020
…unds (#18419)

Doesn't call the `dateFilter` function for date is before the minimum or after the maximum in the month view. We were already doing this for the rest of the views, but I added some tests so we have coverage for it.

Fixes #18411.

(cherry picked from commit 5e34de2)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.