var currentTime = new Date(); var currenthours = parseFloat(currentTime.getHours()); $("#toCollectionTime").prop("disabled", true); $("#fromCollectionTime").change(function () { $("#toCollectionTime").prop("disabled", false); var fromCollectionTime = parseFloat($("#fromCollectionTime :selected").text()); var toCollectionTime = parseFloat($("#toCollectionTime :selected").text()); if (fromCollectionTime < currenthours) { $("#fromCollectionTime").val(currenthours + ":00"); } if (fromCollectionTime > toCollectionTime) { var localFrom = $("#fromCollectionTime :selected").text(); $("#toCollectionTime").val(localFrom); } }); $("#toCollectionTime").change(function () { var fromCollectionTime = parseFloat($("#fromCollectionTime :selected").text()); var toCollectionTime = parseFloat($("#toCollectionTime :selected").text()); if (toCollectionTime < fromCollectionTime) { var localFrom = $("#fromCollectionTime :selected").text(); $("#toCollectionTime").val(localFrom); } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)