');
var date = date1;
month = date.getMonth() + t;
if(month >= 12) {
tyear = year + Math.floor(month / 12);
tttmonth = month % 12;
} else {
tyear = year;
tttmonth = month;
}
if(tttmonth == -1) {
tttmonth = 12;
// tyear = year+ Math.floor(month/11)-1;
tyear = year + Math.floor(month / 12);
}
dayhtml.push('
' + (tttmonth + 1) + '月' + '' + tyear + '
')
var str = '';
$.each(week, function(i, v) {
str += '
' + week[i] + '
';
});
dayhtml.push('
' + str + '
')
var nextdate = new Date(year, month)
var firstweek = nextdate.getDay();
var allday = new Date(parseInt(year), (parseInt(month) + 1), 0).getDate();
var daystr = '
';
for(var i = 0; i < firstweek; i++) {
daystr += '
'
};
for(i = 1; i <= allday; i++) {
var t_m = (tttmonth + 1);
var t_m_str = t_m;
var t_d_str = i;
if(t_m <= 9) {
t_m_str = '0' + t_m;
}
if(i <= 9) {
t_d_str = '0' + i;
}
if(i == today && month == tomonth) {
daystr += '
今天
'
} else if(i < today && month == tomonth) {
daystr += '
' + i + '
'
} else {
daystr += '
' + i + '
'
}
}
daystr += "
";
dayhtml.push(daystr);
dayhtml.push('
');
}
dom.html(dayhtml.join(""))
// ableday 的范围是以前的canday 不同之处是ableday是用业遍历的class 而canday是有css让日期有选
//
$('.aday').each(function(index, domE) {
var current_ymd = getCurrentDate();
var canday_ymd = $(this).attr('data-y') + '-' + $(this).attr('data-m') + '-' + $(this).attr('data-d');
var canday_md = $(this).attr('data-m') + '-' + $(this).attr('data-d');
var week_index = new Date(canday_ymd).getDay();
var arr1 = [1, 2, 3, 4, 5];
var arr2 = [0, 6];
if(sType == window.calendar.init.showTypeEnum.show_all && canday_ymd >= current_ymd) { //全部
$(this).removeClass('disday');
$(this).addClass('canday');
} else if(sType == window.calendar.init.showTypeEnum.show_work_day && $.inArray(week_index, arr1) > -1) { //工作日
$(this).removeClass('disday');
$(this).addClass('canday');
} else if(sType == window.calendar.init.showTypeEnum.show_weekend && $.inArray(week_index, arr2) > -1) { //周末
$(this).removeClass('disday');
$(this).addClass('canday');
} else if(sType == window.calendar.init.showTypeEnum.show_price_day) { // 价格日历
if(show_price_days.hasOwnProperty(canday_ymd)){
$(this).removeClass('disday');
$(this).addClass('canday');
// let cstr = `${$(this).html()}