I am building a component (html, css, spec.ts, ts) in angular in which I always want endDate > startDate. I have followed this link https://material.angular.io/components/datepi
Unless I'm missing something, you can use the [min]=""
date property:
Whatever startDate
is will limit the Calendar dates available for endDate
. If you need it set before startDate
is chosen, use another variable and set it in consturctor()
or ngOnInit()
of your component.
See: https://material.angular.io/components/datepicker/overview#date-validation