选择日期不应显示在日期选择器中的重新单击日期字段中

时间:2018-03-31 05:56:29

标签: jquery datepicker

重新点击时不应显示所选日期,我想再次点击此日期选择

 <span class="RegistrationDate">Registration Date</span>
 <div class=" col-sm-8 col-md-4 col-lg-4  input-group date" id="dateofRegistration" style="padding-top: 10px;">
   <input placeholder="DD/MM/YYYY" type="text" class="form-control" id="datepicker1">
   <div class="input-group-addon" for="datepicker">
     <i class="fa fa-calendar"></i>
   </div>
 </div>
 <script>
  var date = new Date();
  var today = new Date(date.getFullYear(), date.getMonth(), date.getDate());
  var end = new Date(date.getFullYear(), date.getMonth(), date.getDate());
  $('#dateofRegistration').datepicker({
                format: "dd-MM-yyyy",  //"dd-MM-yyyy",
                todayHighlight: true,
                minDate: 0,
                autoclose: true,
                endDate: '+0d'
  });
  $('#dateofRegistration').datepicker('setDate', today);
</script>

0 个答案:

没有答案