如何在datepicker中找到今天的日期?

时间:2016-08-10 07:13:41

标签: javascript c# selenium

SecondViewController

image

1 个答案:

答案 0 :(得分:-1)

$('#startDate').datepicker({
    timepicker:false,
    format:'m/d/Y',
    formatDate:'m/d/Y',
    minDate:0,
    readOnly: true,
    onSelect: function(selected) {
         var dt = new Date(selected); // selected datetime
                  or
         var dt = new Date();  // current datetime
         dt.setDate(dt.getDate() + 1);
     }
    }).keyup(function(e) {
          if (e.keyCode == 8 || e.keyCode == 46) {
              $.datepicker._clearDate(this);
          }
        });