Skip to content

Demo: Min date later than max date improper behavior #12442

Closed
@victoriaaa234

Description

@victoriaaa234

Bug

Improper behavior when the max date selected is earlier than the min date selected.

What is the expected behavior?

If the min date is later than the max date, then after selecting the improper max date, the max date should automatically change to the min date value and everything in the calendar should be disabled in the result.

What is the current behavior?

If the min date is later than the max date, then after selecting improper max date, the max date doesn't automatically change to the min date and the calendar header component isn't disabled, allowing the user to scroll next and previous arrow keys to other months, even though all of the dates are disabled in the result.

https://user-images.githubusercontent.com/15025941/40395029-f90babd2-5dda-11e8-974a-373007197722.png.

What are the steps to reproduce?

  1. Run gulp serve:devapp and go to the Datepicker component.
  2. Choose a min date and then choose a max date that is earlier than the min date.
  3. Open the result, and note the calendar arrows that aren't disabled and the max date doesn't change to the min date.

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

Changing existing behavior so that min date will always be earlier than max date for efficient user usability.

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

Material 2.

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussionhelp wantedThe team would appreciate a PR from the community to address this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions