As shown below:
Copy the code code as follows:
if (new Date(strSD.replace(//-/g, '//')) > new Date(strED.replace(//-/g, '//'))) { //The start time is greater than the end time time
alert("Wrong time selection! The start date must be less than or equal to the end period!");
return false;
}