Skip to content

Datepicker min date doesn't validate if set to today #4918

@farley911

Description

@farley911

Bug, feature request, or proposal:

Bug

What is the expected behavior?

If setting the min property on a date picker component to today I should be able to select today's date.

What is the current behavior?

If I focus on the date picker input, then click on the button and select todays date from the datepicker I will see a validation error saying it's an invalid date.

If I don't focus the input before expanding the datepicker then todays date will be valid, however if I then focus on the input the validation will be updated and the date will no longer be valid.

What are the steps to reproduce?

Create a datepicker with the min property set to today.
Click on the input to focus it.
Click on the calendar button to display the datepicker.
Select todays date.
The date will be invalid.

  • OR -

Create a datepicker with the min property set to today.
Click on the calendar button to expand the datepicker.
Select todays date, it will be valid.
Click on the datepicker input field to focus it.
Click out of the datepicker to trigger validation.
The date will be invalid.

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U

http://plnkr.co/edit/PxXwL5QnVDwgpm5ihOgo?

What is the use-case or motivation for changing an existing behavior?

Bug fix

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest Version

Is there anything else we should know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions