Currently, I am studying date handling and have an object that contains both a start and end date. For example: Startdate = "2019-12-05" and Enddate = "2020-05-20"
My goal is to establish a condition that first verifies the dates are not empty. After that, I want to ensure that the startdate remains unchanged or is updated to a date equal to today's date or later.
if ((startDate != null && endDate != null) && (????????????????)) {
alert('Incorrect date');
this.dateNotValid = false;
}
In place of the ??????? in the code snippet above, I wish to introduce a logic that enforces the startdate to remain either as "2019-12-05" or as today's date "2020-03-02" onwards. Any other date input should trigger an alert error message.