jqueryUi 日历控件
注意事项
.ui-icon-circle-triangle-w{
background: url(../../image/date_left.png) !important;
}
.ui-icon-circle-triangle-e{
background: url(../../image/date_right.png) !important;
}
.ui-datepicker-calendar thead tr th span{
color: #555 !important;
}
css中要加这几个,图片是左右切换<>
要引入js和css 具体的配置,目前我所做的项目配置
var daysArray =[];
var dateObj = {
default_date: "+1w",
dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
monthNamesShort: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
dateFormat: 'yy-mm-dd',
changeMonth: true,
prevBigText: '<<',
changeYear: true,
numberOfMonths: 1,
minDate: new Date("2015/01/01"),
maxDate: new Date(),
beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
if( daysArray.indexOf(string) == -1 ){
return [true,"","此日期没图片"];
}else{
return [true,"unclickdate"];
}
}
}
通过改变数组的日期,重新调用这个控件,可以设置可点不可点日期!