HTML JS 实现农历, 最多计算周期 1900-2100
<!DOCTYPE html>
<head>
<title>LunarCalendar</title>
</head>
<body>
</body>
<script>
/**
* 阴历
*/
function LunarCalendar(year, month, day){
this.year = null;
this.month = null;
this.day = null;
// 跳过
this.leap = false;
// 月份名称
this.chineseNumber = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"];
// 动物属相
this.Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"];
// 天干
this.gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
// 地支
this.zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"];
// 日期格式
this.dataFormat = "yyyy年MM月dd日";
// 阴历信息
this.lunarInfo = [
0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,
0x06566, 0x0d4a0, 0x0ea5