您现在的位置:首页 >> 前端 >> 内容

精通 CSS+DIV 网页样式与布局 164

时间:2017/1/3 9:39:00 点击:

  核心提示:this.year = i;leap = leapMonth(i); //闰哪个月 this.isLeap = false;for (i = 1; i13offset0; i++) {//闰月 if ...
this.year = i;
leap = leapMonth(i); //闰哪个月 
this.isLeap = false;
for (i = 1; i < 13 && offset > 0; i++) {
    //闰月 
    if (leap > 0 && i == (leap + 1) && this.isLeap == false) {–i;
        this.isLeap = true;
        temp = leapDays(this.year);
    } else {
        temp = monthDays(this.year, i);
    }
    //解除闰月 
    if (this.isLeap == true && i == (leap + 1)) this.isLeap = false;
    offset -= temp;
}
if (offset == 0 && leap > 0 && i == leap + 1) if (this.isLeap) {
    this.isLeap = false;
} else {
    this.isLeap = true;–i;
}
if (offset < 0) {
    offset += temp;–i;
}
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

Tags:精通 通C CS SS 
作者:网络 来源:相濡以沫si