我有 kevin lucky 的三个 jQuery datepicker。一个日期选择器是 MultiMonth(即显示),另外两个是绑定到 texbox 的单个月份(即从,到)。如果用户选择从日期和到日期,那么日期范围在从和到之间应该在显示日期选择器中选择。
我的代码是:
$(function () {
$(".Display").datePickerMultiMonth(
{
startDate: '01/01/1996',
numMonths: 3,
inline: true,
selectMultiple: true,
renderCallback: function ($td, thisDate, month, year) {
}
}
}
).bind(
'dpMonthChanged',
function (event, displayedMonth, displayedYear) {
// uncomment if you have firebug and want to confirm this works as expected...
//console.log('dpMonthChanged', arguments);
}
).bind(
'dateSelected',
function (event, date, $td, status) {
// uncomment if you have firebug and want to confirm this works as expected...
//console.log('dateSelected', arguments);
//alert(event + "," + date + "," + $td + "," + status);
}
);
$('#getSelected').bind(
'click',
function (e) {
alert($('div.calendar').dpmmGetSelected());
return false;
}
);
});
$(".from").datePicker({
startDate: '01/01/1996',
renderCallback: function ($td, thisDate, month, year) {
}
});
$(".to").datePicker({
startDate: '01/01/1996',
renderCallback: function ($td, thisDate, month, year) {
}
});
任何建议都会有所帮助。
谢谢。