{ this.isleap = false; }
else
{ this.isleap = true; --i; --this.moncyl;}
if(offset<0){ offset += temp; --i; --this.moncyl; }
this.month = i
this.day = offset + 1
}
//==============================传回国历 y年某m+1月的天数
function solardays(y,m) {
if(m==1)
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28)
else
return(solarmonth[m])
}
//============================== 传入 offset 传回干支, 0=甲子
function cyclical(num) {
return(gan[num%10]+zhi[num%12])
}
//============================== 月历属性
function calelement(syear,smonth,sday,week,lyear,lmonth,lday,isleap,cyear,cmonth,cday) {
this.istoday = false;
//国历
this.syear = syear;
this.smonth = smonth;
this.sday = sday;
this.week = week;
//农历
this.lyear = lyear;
this.lmonth = lmonth;
this.lday = lday;
this.isleap = isleap;
//干支
this.cyear = cyear;
this.cmonth = cmonth;
this.cday = cday;
this.color = '';
this.lunarfestival = ''; //农历节日
this.solarfestival = ''; //国历节日
this.solarterms = ''; //节气
}
//===== 某年的第n个节气为几日(从0小寒起算)
function sterm(y,n) {
var offdate = new date( ( 31556925974.7*(y-1900) + sterminfo[n]*60000 ) + date.utc(1900,0,6,2,5) )
return(offdate.getutcdate())
}
//============================== 传回月历物件 (y年,m+1月)
function calendar(y,m) {
var sdobj, ldobj, ly, lm, ld=1, ll, lx=0, tmp1, tmp2
var ldpos = new array(3)
var n = 0
var firstlm = 0
sdobj = new date(y,m,1) //当月一日日期
this.length = solardays(y,m) //国历当月天数
this.firstweek = sdobj.getday() //国历当月1日星期几
for(var i=0;i