jquery datepicker如何在函数beforeShowDay中获取当前日期?
问题描述:
$('#calendar').datepicker({
inline: true,
beforeShowDay: function(date) {
var currentDay = date.getDate(); //how to get current Day
return [true, "css"];
}
});
答
要设置当前日期作为默认日期:
$("#calendar").datepicker().datepicker("setDate", new Date());