Jquery datepicker如何在showDay之前获取当前功能?

时间:2016-05-31 10:57:13

标签: jquery jquery-ui-datepicker

$('#calendar').datepicker({
    inline: true,
    beforeShowDay:  function(date) {
       var currentDay = date.getDate(); //how to get current Day
       return [true, "css"];
    }
});

1 个答案:

答案 0 :(得分:1)

将当前日期设为默认日期:

$("#calendar").datepicker().datepicker("setDate", new Date());