JS compares two simple sample code for time sizes


As follows:

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