}else{
if(year%400==0){
return true;
}else{
return false;
}
}
},
//显示当前日历内容
showDayList:function(dayNum,SumDayLiNum,oNow){
this.dayList = [];
var rows = parseInt(SumDayLiNum/7);
var cols = 7;
for(var i=0;i<rows;i++){
for(var j=0;j<cols ;j++){
if(j == cols-1){
this.dayList.push({
text:'',
marginRight0:true
})
}else{
this.dayList.push({
text:'',
marginRight0:false
})
}
}
}
for(var z=1;z<=dayNum;z++){
this.dayList[oNow].text = z;
oNow++;
}
},
prevMonth:function(){
if( this.currentMonth == 1){
this.currentYear = this.currentYear - 1;
this.currentMonth = 12;
}else{
this.currentMonth = this.currentMonth - 1;
}
this.calDay(this.currentYear, this.currentMonth);
},
nextMonth:function(){
if( this.currentMonth == 12){
this.currentYear = this.currentYear + 1;
this.currentMonth = 1;
}else{
this.currentMonth = this.currentMonth + 1;
}
this.calDay(this.currentYear, this.currentMonth);
}
}
});
ccal.css代码:
html {
font-family: '微软雅黑';
}
body,
div,
span,
img,
ul,
li,
p {
margin: 0;
padding: 0;
}
ul,
li {
list-style: none;
}
.commonprev {
width: 0.46666667rem;
height: 0.93333333rem;
color: #ffffff;
position: absolute;
display: inline-block;
}
.commonyear {
width: 5.46666667rem;
height: 1.6rem;
font-size: 1rem;
color: #ffffff;
position: absolute;
}
.scCalendar {
width: 25rem;
height: 21.66666667rem;
background: #005498;
background-size: 100%;
}
.scCalendar .calendar_header {
height: 2.93333333rem;
width: 100%;
position: relative;
line-height: 2.93333333rem;
}
.scCalendar .calendar_header .prev {
width: 0.46666667rem;
height: 0.93333333rem;
color: #ffffff;
position: absolute;
display: inline-block;
left: 2.76666667rem;
}
.scCalendar .calendar_header .next {
width: 0.46666667rem;
height: 0.93333333rem;
color: #ffffff;
position: absolute;
display: inline-block;
right: 2.76666667rem;
}
.scCalendar .calendar_header .text_year {
width: 5.46666667rem;
height: 1.6rem;
font-size: 1rem;
color: #ffffff;
position: absolute;
left: 9.76666667rem;










