這是你之前給我的程式碼
<label for="start-date">Start date:</label>
<input type="date" id="start-date" name="start-date">
<br>
<label for="end-date">End date:</label>
<input type="date" id="end-date" name="end-date">

$(function() {
  var $startDate = $("#start-date");
  var $endDate = $("#end-date");

  $startDate.on("change", function() {
    var startDate = new Date($startDate.val());
    var endDate = new Date($endDate.val());
    if (endDate && startDate > endDate) {
      $endDate.val("");
    }
  });

  $endDate.on("change", function() {
    var startDate = new Date($startDate.val());
    var endDate = new Date($endDate.val());
    if (startDate && startDate > endDate) {
      $startDate.val("");
    }
  });
});