As shown below:
if ( New date (strsd.replace (/-/g, '/')) & gt; new date (stred.replace (/-/g, '/')) {// The start time is greater than the end time
alert ("Time selection is wrong! The start date must be less than or equal to the end period!");
Return false;
}