$(function() {
$(".timepicker").timePicker();
$(".datepicker").datepicker({
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
beforeShow: customRange
});
});
function customRange(input) //設定datepicker的日期範圍
{
return {
minDate: (input.id == "pre_statistic_end_date" ? $("#pre_statistic_start_date").datepicker("getDate") : null),
maxDate: (input.id == "pre_statistic_start_date" ? $("#pre_statistic_end_date").datepicker("getDate") : null)
};
}
http://stackoverflow.com/questions/330737/jquery-datepicker-2-inputs-textboxes-and-restricting-range
沒有留言:
張貼留言