q78kgblog 0.0.0-1720168649694 → 0.0.0-1720429643771

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/.github/workflows/HexoSeoAutoPush.yml +8 -12
  2. package/404.html +4 -4
  3. package/about/index.html +6 -6
  4. package/archives/2023/02/index.html +5 -5
  5. package/archives/2023/04/index.html +5 -5
  6. package/archives/2023/05/index.html +5 -5
  7. package/archives/2023/08/index.html +5 -5
  8. package/archives/2023/09/index.html +5 -5
  9. package/archives/2023/index.html +5 -5
  10. package/archives/2024/01/index.html +5 -5
  11. package/archives/2024/02/index.html +5 -5
  12. package/archives/2024/index.html +5 -5
  13. package/archives/index.html +5 -5
  14. package/atom.xml +9 -9
  15. package/baidusitemap.xml +8 -8
  16. package/bangumis/index.html +6 -7
  17. package/bigpie/index.html +4 -4
  18. package/categories/Hexo/index.html +5 -5
  19. package/categories/index.html +4 -4
  20. package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +5 -5
  21. package/categories//347/264/240/346/235/220/index.html +5 -5
  22. package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +5 -5
  23. package/content.json +1 -1
  24. package/css/ariasakablog.css +0 -6669
  25. package/css/danmaku.css +0 -2
  26. package/fcircle/index.html +4 -4
  27. package/fontawesome/index.html +4 -4
  28. package/index.html +12 -12
  29. package/js/commentBarrage.js +201 -201
  30. package/js/day.js +110 -110
  31. package/js/dianzan.js +5 -5
  32. package/js/dis.js +242 -241
  33. package/js/fps.js +55 -54
  34. package/js/gitalker.js +1 -1
  35. package/js/heimu.js +16 -15
  36. package/js/hide.show.js +5 -5
  37. package/js/languages.js +510 -510
  38. package/js/lunar.js +517 -517
  39. package/js/main.js +8 -8
  40. package/js/resizeTop.js +31 -31
  41. package/js/settings.js +303 -302
  42. package/js/sitetime.js +11 -11
  43. package/js/welcomeconsole.js +9 -8
  44. package/links/index.html +4 -4
  45. package/othersite/index.html +4 -4
  46. package/package.json +1 -1
  47. package/posts/164ef646/index.html +7 -7
  48. package/posts/228c2ef8/index.html +7 -7
  49. package/posts/a9a6c1fb/index.html +7 -7
  50. package/posts/c262e439/index.html +7 -7
  51. package/posts/c81531cf/index.html +7 -7
  52. package/posts/ccdf7cfc/index.html +7 -7
  53. package/posts/de1f83f4/index.html +7 -7
  54. package/posts/e54f7476/index.html +7 -7
  55. package/random.html +2 -2
  56. package/sitemap.txt +2 -2
  57. package/sitemap.xml +55 -55
  58. package/tags/AI/index.html +6 -6
  59. package/tags/Butterfly/index.html +6 -6
  60. package/tags/Cloudflare/index.html +6 -6
  61. package/tags/DiffSinger/index.html +6 -6
  62. package/tags/Hexo/index.html +6 -6
  63. package/tags/Next/index.html +6 -6
  64. package/tags/RAID/index.html +6 -6
  65. package/tags/Vercel/index.html +6 -6
  66. package/tags/Workers/index.html +6 -6
  67. package/tags/index.html +4 -4
  68. package/tags//344/270/273/351/242/230/index.html +6 -6
  69. package/tags//345/206/231/344/275/234/index.html +6 -6
  70. package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +6 -6
  71. package/tags//345/255/246/344/271/240/index.html +6 -6
  72. package/tags//345/256/266/351/207/214/344/272/221/index.html +6 -6
  73. package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +6 -6
  74. package/tags//346/212/230/350/205/276/index.html +6 -6
  75. package/tags//346/227/245/345/270/270/index.html +6 -6
  76. package/tags//346/234/215/345/212/241/345/231/250/index.html +6 -6
  77. package/tags//346/265/252/346/275/256/index.html +6 -6
  78. package/tags//347/256/200/347/210/261/index.html +6 -6
  79. package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +6 -6
  80. package/tags//350/256/272/346/226/207/index.html +6 -6
  81. package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +6 -6
  82. package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +6 -6
  83. package/tags//351/207/221/345/217/245/index.html +6 -6
  84. package/tags//351/255/224/346/224/271/index.html +6 -6
package/js/lunar.js CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  */
14
14
 
15
-
15
+
16
16
 
17
17
  /**
18
18
 
@@ -26,1046 +26,1046 @@
26
26
 
27
27
  var lunarInfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, // 1900-1909
28
28
 
29
- 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919
29
+ 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919
30
30
 
31
- 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929
31
+ 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929
32
32
 
33
- 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939
33
+ 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939
34
34
 
35
- 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949
35
+ 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949
36
36
 
37
- 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959
37
+ 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959
38
38
 
39
- 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969
39
+ 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969
40
40
 
41
- 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979
41
+ 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979
42
42
 
43
- 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989
43
+ 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989
44
44
 
45
- 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999
45
+ 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999
46
46
 
47
- 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009
47
+ 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009
48
48
 
49
- 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019
49
+ 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019
50
50
 
51
- 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029
51
+ 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029
52
52
 
53
- 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039
53
+ 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039
54
54
 
55
- 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049
55
+ 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049
56
56
 
57
- 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059
57
+ 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059
58
58
 
59
- 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069
59
+ 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069
60
60
 
61
- 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079
61
+ 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079
62
62
 
63
- 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089
63
+ 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089
64
64
 
65
- 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099
65
+ 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099
66
66
 
67
- 0x0d520] // 2100
67
+ 0x0d520] // 2100
68
68
 
69
-
70
69
 
71
- var solarMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
72
70
 
73
-
71
+ var solarMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
74
72
 
75
- /**
76
73
 
77
- * 天干地支之天干速查表
78
74
 
79
- * @Array Of Property trans['甲','乙','丙','丁','戊','己','庚','辛','壬','癸']
75
+ /**
80
76
 
81
- * @return Cn string
77
+ * 天干地支之天干速查表
82
78
 
83
- */
79
+ * @Array Of Property trans['甲','乙','丙','丁','戊','己','庚','辛','壬','癸']
84
80
 
85
- var Gan = ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678']
81
+ * @return Cn string
86
82
 
87
-
83
+ */
88
84
 
89
- /**
85
+ var Gan = ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678']
90
86
 
91
- * 天干地支之地支速查表
92
87
 
93
- * @Array Of Property
94
88
 
95
- * @trans['子','丑','寅','卯','辰','巳','午','未','申','酉','戌','亥']
89
+ /**
96
90
 
97
- * @return Cn string
91
+ * 天干地支之地支速查表
98
92
 
99
- */
93
+ * @Array Of Property
100
94
 
101
- var Zhi = ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5']
95
+ * @trans['','','','','','','','','','','','']
102
96
 
103
-
97
+ * @return Cn string
104
98
 
105
- /**
99
+ */
106
100
 
107
- * 天干地支之地支速查表<=>生肖
101
+ var Zhi = ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5']
108
102
 
109
- * @Array Of Property
110
103
 
111
- * @trans['鼠','牛','虎','兔','龙','蛇','马','羊','猴','鸡','狗','猪']
112
104
 
113
- * @return Cn string
105
+ /**
114
106
 
115
- */
107
+ * 天干地支之地支速查表<=>生肖
116
108
 
117
- var Animals = ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a']
109
+ * @Array Of Property
118
110
 
119
-
111
+ * @trans['鼠','牛','虎','兔','龙','蛇','马','羊','猴','鸡','狗','猪']
120
112
 
121
- /**
113
+ * @return Cn string
122
114
 
123
- * 24节气速查表
115
+ */
124
116
 
125
- * @Array Of Property
117
+ var Animals = ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a']
126
118
 
127
- * @trans['小寒','大寒','立春','雨水','惊蛰','春分','清明','谷雨','立夏','小满','芒种','夏至','小暑','大暑','立秋','处暑','白露','秋分','寒露','霜降','立冬','小雪','大雪','冬至']
128
119
 
129
- * @return Cn string
130
120
 
131
- */
121
+ /**
132
122
 
133
- var solarTerm = ['\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3']
123
+ * 24节气速查表
134
124
 
135
-
125
+ * @Array Of Property
136
126
 
137
- /**
127
+ * @trans['小寒','大寒','立春','雨水','惊蛰','春分','清明','谷雨','立夏','小满','芒种','夏至','小暑','大暑','立秋','处暑','白露','秋分','寒露','霜降','立冬','小雪','大雪','冬至']
138
128
 
139
- * 1900-2100各年的24节气日期速查表
129
+ * @return Cn string
140
130
 
141
- * @Array Of Property
131
+ */
142
132
 
143
- * @return 0x string For splice
133
+ var solarTerm = ['\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3']
144
134
 
145
- */
146
135
 
147
- var sTermInfo = ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
148
136
 
149
- '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
137
+ /**
150
138
 
151
- '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
139
+ * 1900-2100各年的24节气日期速查表
152
140
 
153
- '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
141
+ * @Array Of Property
154
142
 
155
- 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
143
+ * @return 0x string For splice
156
144
 
157
- '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
145
+ */
158
146
 
159
- '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
147
+ var sTermInfo = ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
160
148
 
161
- '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
149
+ '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
162
150
 
163
- '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
151
+ '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
164
152
 
165
- '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
153
+ '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
166
154
 
167
- '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
155
+ 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
168
156
 
169
- '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
157
+ '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
170
158
 
171
- '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
159
+ '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
172
160
 
173
- '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
161
+ '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
174
162
 
175
- '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
163
+ '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
176
164
 
177
- '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
165
+ '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
178
166
 
179
- '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
167
+ '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
180
168
 
181
- '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
169
+ '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
182
170
 
183
- '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
171
+ '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
184
172
 
185
- '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
173
+ '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
186
174
 
187
- '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
175
+ '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
188
176
 
189
- '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
177
+ '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
190
178
 
191
- '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
179
+ '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
192
180
 
193
- '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
181
+ '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
194
182
 
195
- '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
183
+ '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
196
184
 
197
- '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
185
+ '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
198
186
 
199
- '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
187
+ '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
200
188
 
201
- '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
189
+ '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
202
190
 
203
- '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
191
+ '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
204
192
 
205
- '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
193
+ '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
206
194
 
207
- '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
195
+ '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
208
196
 
209
- '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
197
+ '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
210
198
 
211
- '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
199
+ '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
212
200
 
213
- '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
201
+ '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
214
202
 
215
- '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
203
+ '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
216
204
 
217
- '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
205
+ '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
218
206
 
219
- '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
207
+ '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
220
208
 
221
- '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
209
+ '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
222
210
 
223
- '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
211
+ '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
224
212
 
225
- '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
213
+ '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
226
214
 
227
- '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
215
+ '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
228
216
 
229
- '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
217
+ '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
230
218
 
231
- '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
219
+ '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
232
220
 
233
- '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
221
+ '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
234
222
 
235
- '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
223
+ '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
236
224
 
237
- '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
225
+ '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
238
226
 
239
- '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
227
+ '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
240
228
 
241
- '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
229
+ '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
242
230
 
243
- '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
231
+ '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
244
232
 
245
- '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
233
+ '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
246
234
 
247
- '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
235
+ '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
248
236
 
249
- '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
237
+ '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
250
238
 
251
- '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
239
+ '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
252
240
 
253
- '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
241
+ '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
254
242
 
255
- '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
243
+ '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
256
244
 
257
- '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
245
+ '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
258
246
 
259
- '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
247
+ '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
260
248
 
261
- '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
249
+ '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
262
250
 
263
- '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
251
+ '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
264
252
 
265
- '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
253
+ '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
266
254
 
267
- '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
255
+ '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
268
256
 
269
- '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
257
+ '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
270
258
 
271
- '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
259
+ '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
272
260
 
273
- '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
261
+ '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
274
262
 
275
- '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
263
+ '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
276
264
 
277
- '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
265
+ '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
278
266
 
279
- '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722']
267
+ '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
280
268
 
281
-
269
+ '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
282
270
 
283
- /**
271
+ '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
284
272
 
285
- * 数字转中文速查表
273
+ '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
286
274
 
287
- * @Array Of Property
275
+ '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
288
276
 
289
- * @trans ['','','','三','四','五','六','七','八','九','十']
277
+ '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
290
278
 
291
- * @return Cn string
279
+ '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722']
292
280
 
293
- */
294
281
 
295
- var nStr1 = ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341']
296
282
 
297
-
283
+ /**
298
284
 
299
- /**
285
+ * 数字转中文速查表
300
286
 
301
- * 日期转农历称呼速查表
287
+ * @Array Of Property
302
288
 
303
- * @Array Of Property
289
+ * @trans ['日','一','二','三','四','五','六','七','八','九','十']
304
290
 
305
- * @trans ['初','十','廿','卅']
291
+ * @return Cn string
306
292
 
307
- * @return Cn string
293
+ */
308
294
 
309
- */
295
+ var nStr1 = ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341']
310
296
 
311
- var nStr2 = ['\u521d', '\u5341', '\u5eff', '\u5345']
312
297
 
313
-
314
298
 
315
- /**
299
+ /**
316
300
 
317
- * 月份转农历称呼速查表
301
+ * 日期转农历称呼速查表
318
302
 
319
- * @Array Of Property
303
+ * @Array Of Property
320
304
 
321
- * @trans ['','一','二','三','四','五','六','七','八','九','十','','']
305
+ * @trans ['','十','廿','']
322
306
 
323
- * @return Cn string
307
+ * @return Cn string
324
308
 
325
- */
309
+ */
326
310
 
327
- var nStr3 = ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a']
311
+ var nStr2 = ['\u521d', '\u5341', '\u5eff', '\u5345']
328
312
 
329
-
330
313
 
331
- /**
332
314
 
333
- * 返回农历y年一整年的总天数
315
+ /**
334
316
 
335
- * @param lunar Year
317
+ * 月份转农历称呼速查表
336
318
 
337
- * @return Number
319
+ * @Array Of Property
338
320
 
339
- * @eg:var count = calendar.lYearDays(1987) ;//count=387
321
+ * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
340
322
 
341
- */
323
+ * @return Cn string
342
324
 
343
- function lYearDays (y) {
325
+ */
344
326
 
345
- var i
327
+ var nStr3 = ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a']
346
328
 
347
- var sum = 348
348
329
 
349
- for (i = 0x8000; i > 0x8; i >>= 1) { sum += (lunarInfo[y - 1900] & i) ? 1 : 0 }
350
330
 
351
- return (sum + leapDays(y))
331
+ /**
352
332
 
353
- }
333
+ * 返回农历y年一整年的总天数
354
334
 
355
-
335
+ * @param lunar Year
356
336
 
357
- /**
337
+ * @return Number
358
338
 
359
- * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
339
+ * @eg:var count = calendar.lYearDays(1987) ;//count=387
360
340
 
361
- * @param lunar Year
341
+ */
362
342
 
363
- * @return Number (0-12)
343
+ function lYearDays(y) {
364
344
 
365
- * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
345
+ var i
366
346
 
367
- */
347
+ var sum = 348
368
348
 
369
- function leapMonth (y) { // 闰字编码 \u95f0
349
+ for (i = 0x8000; i > 0x8; i >>= 1) { sum += (lunarInfo[y - 1900] & i) ? 1 : 0 }
370
350
 
371
- return (lunarInfo[y - 1900] & 0xf)
351
+ return (sum + leapDays(y))
372
352
 
373
- }
353
+ }
374
354
 
375
-
376
355
 
377
- /**
378
356
 
379
- * 返回农历y年闰月的天数 若该年没有闰月则返回0
357
+ /**
380
358
 
381
- * @param lunar Year
359
+ * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
382
360
 
383
- * @return Number (0、29、30)
361
+ * @param lunar Year
384
362
 
385
- * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
363
+ * @return Number (0-12)
386
364
 
387
- */
365
+ * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
388
366
 
389
- function leapDays (y) {
367
+ */
390
368
 
391
- if (leapMonth(y)) {
369
+ function leapMonth(y) { // 闰字编码 \u95f0
392
370
 
393
- return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
371
+ return (lunarInfo[y - 1900] & 0xf)
394
372
 
395
- }
373
+ }
374
+
375
+
376
+
377
+ /**
378
+
379
+ * 返回农历y年闰月的天数 若该年没有闰月则返回0
380
+
381
+ * @param lunar Year
382
+
383
+ * @return Number (0、29、30)
396
384
 
397
- return (0)
385
+ * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
386
+
387
+ */
388
+
389
+ function leapDays(y) {
390
+
391
+ if (leapMonth(y)) {
392
+
393
+ return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
398
394
 
399
395
  }
400
396
 
401
-
397
+ return (0)
402
398
 
403
- /**
399
+ }
404
400
 
405
- * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
406
401
 
407
- * @param lunar Year
408
402
 
409
- * @return Number (-1、29、30)
403
+ /**
410
404
 
411
- * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
405
+ * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
412
406
 
413
- */
407
+ * @param lunar Year
414
408
 
415
- function monthDays (y, m) {
409
+ * @return Number (-1、29、30)
416
410
 
417
- if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1
411
+ * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
418
412
 
419
- return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
413
+ */
420
414
 
421
- }
415
+ function monthDays(y, m) {
422
416
 
423
-
417
+ if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1
424
418
 
425
- /**
419
+ return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
426
420
 
427
- * 返回公历(!)y年m月的天数
421
+ }
428
422
 
429
- * @param solar Year
430
423
 
431
- * @return Number (-1、28、29、30、31)
432
424
 
433
- * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
425
+ /**
434
426
 
435
- */
427
+ * 返回公历(!)y年m月的天数
428
+
429
+ * @param solar Year
436
430
 
437
- function solarDays (y, m) {
431
+ * @return Number (-1、28、29、30、31)
438
432
 
439
- if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
433
+ * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
440
434
 
441
- var ms = m - 1
435
+ */
442
436
 
443
- if (ms === 1) { // 2月份的闰平规律测算后确认返回28或29
437
+ function solarDays(y, m) {
444
438
 
445
- return (((y % 4 === 0) && (y % 100 !== 0) || (y % 400 === 0)) ? 29 : 28)
439
+ if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
446
440
 
447
- } else {
441
+ var ms = m - 1
448
442
 
449
- return (solarMonth[ms])
443
+ if (ms === 1) { // 2月份的闰平规律测算后确认返回28或29
450
444
 
451
- }
445
+ return (((y % 4 === 0) && (y % 100 !== 0) || (y % 400 === 0)) ? 29 : 28)
446
+
447
+ } else {
448
+
449
+ return (solarMonth[ms])
452
450
 
453
451
  }
454
452
 
455
-
453
+ }
456
454
 
457
- /**
458
455
 
459
- * 农历年份转换为干支纪年
460
456
 
461
- * @param lYear 农历年的年份数
457
+ /**
462
458
 
463
- * @return Cn string
459
+ * 农历年份转换为干支纪年
464
460
 
465
- */
461
+ * @param lYear 农历年的年份数
466
462
 
467
- function toGanZhiYear (lYear) {
463
+ * @return Cn string
468
464
 
469
- var ganKey = (lYear - 3) % 10
465
+ */
470
466
 
471
- var zhiKey = (lYear - 3) % 12
467
+ function toGanZhiYear(lYear) {
472
468
 
473
- if (ganKey === 0) ganKey = 10 // 如果余数为0则为最后一个天干
469
+ var ganKey = (lYear - 3) % 10
474
470
 
475
- if (zhiKey === 0) zhiKey = 12 // 如果余数为0则为最后一个地支
471
+ var zhiKey = (lYear - 3) % 12
476
472
 
477
- return Gan[ganKey - 1] + Zhi[zhiKey - 1]
473
+ if (ganKey === 0) ganKey = 10 // 如果余数为0则为最后一个天干
478
474
 
479
- }
475
+ if (zhiKey === 0) zhiKey = 12 // 如果余数为0则为最后一个地支
480
476
 
481
-
477
+ return Gan[ganKey - 1] + Zhi[zhiKey - 1]
482
478
 
483
- /**
479
+ }
484
480
 
485
- * 公历月、日判断所属星座
486
481
 
487
- * @param cMonth [description]
488
482
 
489
- * @param cDay [description]
483
+ /**
490
484
 
491
- * @return Cn string
485
+ * 公历月、日判断所属星座
492
486
 
493
- */
487
+ * @param cMonth [description]
494
488
 
495
- function toAstro (cMonth, cDay) {
489
+ * @param cDay [description]
496
490
 
497
- var s = '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf'
491
+ * @return Cn string
498
492
 
499
- var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]
493
+ */
500
494
 
501
- return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7' // 座
495
+ function toAstro(cMonth, cDay) {
502
496
 
503
- }
497
+ var s = '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf'
504
498
 
505
-
499
+ var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22]
506
500
 
507
- /**
501
+ return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7' // 座
508
502
 
509
- * 传入offset偏移量返回干支
503
+ }
510
504
 
511
- * @param offset 相对甲子的偏移量
512
505
 
513
- * @return Cn string
514
506
 
515
- */
507
+ /**
516
508
 
517
- function toGanZhi (offset) {
509
+ * 传入offset偏移量返回干支
518
510
 
519
- return Gan[offset % 10] + Zhi[offset % 12]
511
+ * @param offset 相对甲子的偏移量
520
512
 
521
- }
513
+ * @return Cn string
522
514
 
523
-
515
+ */
524
516
 
525
- /**
517
+ function toGanZhi(offset) {
526
518
 
527
- * 传入公历(!)y年获得该年第n个节气的公历日期
519
+ return Gan[offset % 10] + Zhi[offset % 12]
528
520
 
529
- * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
521
+ }
530
522
 
531
- * @return day Number
532
523
 
533
- * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
534
524
 
535
- */
525
+ /**
536
526
 
537
- function getTerm (y, n) {
527
+ * 传入公历(!)y年获得该年第n个节气的公历日期
538
528
 
539
- if (y < 1900 || y > 2100) { return -1 }
529
+ * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
540
530
 
541
- if (n < 1 || n > 24) { return -1 }
531
+ * @return day Number
542
532
 
543
- var _table = sTermInfo[y - 1900]
533
+ * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
544
534
 
545
- var _info = [
535
+ */
546
536
 
547
- parseInt('0x' + _table.substr(0, 5)).toString(),
537
+ function getTerm(y, n) {
548
538
 
549
- parseInt('0x' + _table.substr(5, 5)).toString(),
539
+ if (y < 1900 || y > 2100) { return -1 }
550
540
 
551
- parseInt('0x' + _table.substr(10, 5)).toString(),
541
+ if (n < 1 || n > 24) { return -1 }
552
542
 
553
- parseInt('0x' + _table.substr(15, 5)).toString(),
543
+ var _table = sTermInfo[y - 1900]
554
544
 
555
- parseInt('0x' + _table.substr(20, 5)).toString(),
545
+ var _info = [
556
546
 
557
- parseInt('0x' + _table.substr(25, 5)).toString()
547
+ parseInt('0x' + _table.substr(0, 5)).toString(),
558
548
 
559
- ]
549
+ parseInt('0x' + _table.substr(5, 5)).toString(),
560
550
 
561
- var _calday = [
551
+ parseInt('0x' + _table.substr(10, 5)).toString(),
562
552
 
563
- _info[0].substr(0, 1),
553
+ parseInt('0x' + _table.substr(15, 5)).toString(),
564
554
 
565
- _info[0].substr(1, 2),
555
+ parseInt('0x' + _table.substr(20, 5)).toString(),
566
556
 
567
- _info[0].substr(3, 1),
557
+ parseInt('0x' + _table.substr(25, 5)).toString()
568
558
 
569
- _info[0].substr(4, 2),
559
+ ]
570
560
 
571
-
561
+ var _calday = [
572
562
 
573
- _info[1].substr(0, 1),
563
+ _info[0].substr(0, 1),
574
564
 
575
- _info[1].substr(1, 2),
565
+ _info[0].substr(1, 2),
576
566
 
577
- _info[1].substr(3, 1),
567
+ _info[0].substr(3, 1),
578
568
 
579
- _info[1].substr(4, 2),
569
+ _info[0].substr(4, 2),
580
570
 
581
-
582
571
 
583
- _info[2].substr(0, 1),
584
572
 
585
- _info[2].substr(1, 2),
573
+ _info[1].substr(0, 1),
586
574
 
587
- _info[2].substr(3, 1),
575
+ _info[1].substr(1, 2),
588
576
 
589
- _info[2].substr(4, 2),
577
+ _info[1].substr(3, 1),
590
578
 
591
-
579
+ _info[1].substr(4, 2),
592
580
 
593
- _info[3].substr(0, 1),
594
581
 
595
- _info[3].substr(1, 2),
596
582
 
597
- _info[3].substr(3, 1),
583
+ _info[2].substr(0, 1),
598
584
 
599
- _info[3].substr(4, 2),
585
+ _info[2].substr(1, 2),
600
586
 
601
-
587
+ _info[2].substr(3, 1),
602
588
 
603
- _info[4].substr(0, 1),
589
+ _info[2].substr(4, 2),
604
590
 
605
- _info[4].substr(1, 2),
606
591
 
607
- _info[4].substr(3, 1),
608
592
 
609
- _info[4].substr(4, 2),
593
+ _info[3].substr(0, 1),
610
594
 
611
-
595
+ _info[3].substr(1, 2),
612
596
 
613
- _info[5].substr(0, 1),
597
+ _info[3].substr(3, 1),
614
598
 
615
- _info[5].substr(1, 2),
599
+ _info[3].substr(4, 2),
616
600
 
617
- _info[5].substr(3, 1),
618
601
 
619
- _info[5].substr(4, 2)
620
602
 
621
- ]
603
+ _info[4].substr(0, 1),
622
604
 
623
- return parseInt(_calday[n - 1])
605
+ _info[4].substr(1, 2),
624
606
 
625
- }
607
+ _info[4].substr(3, 1),
626
608
 
627
-
609
+ _info[4].substr(4, 2),
628
610
 
629
- /**
630
611
 
631
- * 传入农历数字月份返回汉语通俗表示法
632
612
 
633
- * @param lunar month
613
+ _info[5].substr(0, 1),
634
614
 
635
- * @return Cn string
615
+ _info[5].substr(1, 2),
636
616
 
637
- * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
617
+ _info[5].substr(3, 1),
638
618
 
639
- */
619
+ _info[5].substr(4, 2)
640
620
 
641
- function toChinaMonth (m) { // 月 => \u6708
621
+ ]
642
622
 
643
- if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
623
+ return parseInt(_calday[n - 1])
644
624
 
645
- var s = nStr3[m - 1]
625
+ }
646
626
 
647
- s += '\u6708' // 加上月字
648
627
 
649
- return s
650
628
 
651
- }
629
+ /**
652
630
 
653
-
631
+ * 传入农历数字月份返回汉语通俗表示法
654
632
 
655
- /**
633
+ * @param lunar month
656
634
 
657
- * 传入农历日期数字返回汉字表示法
635
+ * @return Cn string
658
636
 
659
- * @param lunar day
637
+ * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
660
638
 
661
- * @return Cn string
639
+ */
662
640
 
663
- * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
641
+ function toChinaMonth(m) { // => \u6708
664
642
 
665
- */
643
+ if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1
666
644
 
667
- function toChinaDay (d) { // 日 => \u65e5
645
+ var s = nStr3[m - 1]
668
646
 
669
- var s
647
+ s += '\u6708' // 加上月字
670
648
 
671
- switch (d) {
649
+ return s
672
650
 
673
- case 10:
651
+ }
674
652
 
675
- s = '\u521d\u5341'
676
653
 
677
- break
678
654
 
679
- case 20:
655
+ /**
680
656
 
681
- s = '\u4e8c\u5341'
657
+ * 传入农历日期数字返回汉字表示法
682
658
 
683
- break
659
+ * @param lunar day
684
660
 
685
- case 30:
661
+ * @return Cn string
686
662
 
687
- s = '\u4e09\u5341'
663
+ * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
688
664
 
689
- break
665
+ */
690
666
 
691
- default :
667
+ function toChinaDay(d) { // 日 => \u65e5
692
668
 
693
- s = nStr2[Math.floor(d / 10)]
669
+ var s
694
670
 
695
- s += nStr1[d % 10]
671
+ switch (d) {
696
672
 
697
- }
673
+ case 10:
698
674
 
699
- return (s)
675
+ s = '\u521d\u5341'
700
676
 
701
- }
677
+ break
702
678
 
703
-
679
+ case 20:
704
680
 
705
- /**
681
+ s = '\u4e8c\u5341'
706
682
 
707
- * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
683
+ break
708
684
 
709
- * @param y year
685
+ case 30:
710
686
 
711
- * @return Cn string
687
+ s = '\u4e09\u5341'
712
688
 
713
- * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
689
+ break
714
690
 
715
- */
691
+ default:
716
692
 
717
- function getAnimal (y) {
693
+ s = nStr2[Math.floor(d / 10)]
718
694
 
719
- return Animals[(y - 4) % 12]
695
+ s += nStr1[d % 10]
720
696
 
721
697
  }
722
698
 
723
-
699
+ return (s)
724
700
 
725
- /**
701
+ }
726
702
 
727
- * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
728
703
 
729
- * @param y solar year
730
704
 
731
- * @param m solar month
705
+ /**
732
706
 
733
- * @param d solar day
707
+ * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
734
708
 
735
- * @return JSON object
709
+ * @param y year
736
710
 
737
- * @eg:console.log(calendar.solar2lunar(1987,11,01));
711
+ * @return Cn string
738
712
 
739
- */
713
+ * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
740
714
 
741
- function solar2lunar (y, m, d) { // 参数区间1900.1.31~2100.12.31
715
+ */
742
716
 
743
- // 年份限定、上限
717
+ function getAnimal(y) {
744
718
 
745
- if (y < 1900 || y > 2100) {
719
+ return Animals[(y - 4) % 12]
746
720
 
747
- return -1 // undefined转换为数字变为NaN
721
+ }
748
722
 
749
- }
750
723
 
751
- // 公历传参最下限
752
724
 
753
- if (y === 1900 && m === 1 && d < 31) {
725
+ /**
754
726
 
755
- return -1
727
+ * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
756
728
 
757
- }
729
+ * @param y solar year
758
730
 
759
- // 未传参 获得当天
731
+ * @param m solar month
760
732
 
761
- var objDate = null
733
+ * @param d solar day
762
734
 
763
- if (!y) {
735
+ * @return JSON object
764
736
 
765
- objDate = new Date()
737
+ * @eg:console.log(calendar.solar2lunar(1987,11,01));
766
738
 
767
- } else {
739
+ */
768
740
 
769
- objDate = new Date(y, parseInt(m) - 1, d)
741
+ function solar2lunar(y, m, d) { // 参数区间1900.1.31~2100.12.31
770
742
 
771
- }
743
+ // 年份限定、上限
772
744
 
773
- var i
745
+ if (y < 1900 || y > 2100) {
774
746
 
775
- var leap = 0
747
+ return -1 // undefined转换为数字变为NaN
776
748
 
777
- var temp = 0
749
+ }
778
750
 
779
- // 修正ymd参数
751
+ // 公历传参最下限
780
752
 
781
- y = objDate.getFullYear()
753
+ if (y === 1900 && m === 1 && d < 31) {
782
754
 
783
- m = objDate.getMonth() + 1
755
+ return -1
784
756
 
785
- d = objDate.getDate()
757
+ }
786
758
 
787
- var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000
759
+ // 未传参 获得当天
788
760
 
789
- for (i = 1900; i < 2101 && offset > 0; i++) {
761
+ var objDate = null
790
762
 
791
- temp = lYearDays(i)
763
+ if (!y) {
792
764
 
793
- offset -= temp
765
+ objDate = new Date()
794
766
 
795
- }
767
+ } else {
796
768
 
797
- if (offset < 0) {
769
+ objDate = new Date(y, parseInt(m) - 1, d)
798
770
 
799
- offset += temp; i--
771
+ }
800
772
 
801
- }
773
+ var i
802
774
 
803
-
775
+ var leap = 0
804
776
 
805
- // 是否今天
777
+ var temp = 0
806
778
 
807
- var isTodayObj = new Date()
779
+ // 修正ymd参数
808
780
 
809
- var isToday = false
781
+ y = objDate.getFullYear()
810
782
 
811
- if (isTodayObj.getFullYear() === y && isTodayObj.getMonth() + 1 === m && isTodayObj.getDate() === d) {
783
+ m = objDate.getMonth() + 1
812
784
 
813
- isToday = true
785
+ d = objDate.getDate()
814
786
 
815
- }
787
+ var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000
816
788
 
817
- // 星期几
789
+ for (i = 1900; i < 2101 && offset > 0; i++) {
818
790
 
819
- var nWeek = objDate.getDay()
791
+ temp = lYearDays(i)
820
792
 
821
- var cWeek = nStr1[nWeek]
793
+ offset -= temp
822
794
 
823
- // 数字表示周几顺应天朝周一开始的惯例
795
+ }
824
796
 
825
- if (nWeek === 0) {
797
+ if (offset < 0) {
826
798
 
827
- nWeek = 7
799
+ offset += temp; i--
828
800
 
829
- }
801
+ }
830
802
 
831
- // 农历年
832
803
 
833
- var year = i
834
804
 
835
- leap = leapMonth(i) // 闰哪个月
805
+ // 是否今天
836
806
 
837
- var isLeap = false
807
+ var isTodayObj = new Date()
838
808
 
839
-
809
+ var isToday = false
840
810
 
841
- // 效验闰月
811
+ if (isTodayObj.getFullYear() === y && isTodayObj.getMonth() + 1 === m && isTodayObj.getDate() === d) {
842
812
 
843
- for (i = 1; i < 13 && offset > 0; i++) {
813
+ isToday = true
844
814
 
845
- // 闰月
815
+ }
846
816
 
847
- if (leap > 0 && i === (leap + 1) && isLeap === false) {
817
+ // 星期几
848
818
 
849
- --i
819
+ var nWeek = objDate.getDay()
850
820
 
851
- isLeap = true; temp = leapDays(year) // 计算农历闰月天数
821
+ var cWeek = nStr1[nWeek]
852
822
 
853
- } else {
823
+ // 数字表示周几顺应天朝周一开始的惯例
854
824
 
855
- temp = monthDays(year, i)// 计算农历普通月天数
825
+ if (nWeek === 0) {
856
826
 
857
- }
827
+ nWeek = 7
858
828
 
859
- // 解除闰月
829
+ }
860
830
 
861
- if (isLeap === true && i === (leap + 1)) { isLeap = false }
831
+ // 农历年
862
832
 
863
- offset -= temp
833
+ var year = i
864
834
 
865
- }
835
+ leap = leapMonth(i) // 闰哪个月
866
836
 
867
- // 闰月导致数组下标重叠取反
837
+ var isLeap = false
868
838
 
869
- if (offset === 0 && leap > 0 && i === leap + 1) {
870
839
 
871
- if (isLeap) {
872
840
 
873
- isLeap = false
841
+ // 效验闰月
874
842
 
875
- } else {
843
+ for (i = 1; i < 13 && offset > 0; i++) {
876
844
 
877
- isLeap = true; --i
845
+ // 闰月
878
846
 
879
- }
847
+ if (leap > 0 && i === (leap + 1) && isLeap === false) {
880
848
 
881
- }
849
+ --i
850
+
851
+ isLeap = true; temp = leapDays(year) // 计算农历闰月天数
882
852
 
883
- if (offset < 0) {
853
+ } else {
884
854
 
885
- offset += temp; --i
855
+ temp = monthDays(year, i)// 计算农历普通月天数
886
856
 
887
857
  }
888
858
 
889
- // 农历月
859
+ // 解除闰月
890
860
 
891
- var month = i
861
+ if (isLeap === true && i === (leap + 1)) { isLeap = false }
892
862
 
893
- // 农历日
863
+ offset -= temp
894
864
 
895
- var day = offset + 1
865
+ }
896
866
 
897
- // 天干地支处理
867
+ // 闰月导致数组下标重叠取反
898
868
 
899
- var sm = m - 1
869
+ if (offset === 0 && leap > 0 && i === leap + 1) {
900
870
 
901
- var gzY = toGanZhiYear(year)
871
+ if (isLeap) {
902
872
 
903
-
873
+ isLeap = false
904
874
 
905
- // 当月的两个节气
875
+ } else {
906
876
 
907
- // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
877
+ isLeap = true; --i
908
878
 
909
- var firstNode = getTerm(y, (m * 2 - 1)) // 返回当月「节」为几日开始
879
+ }
910
880
 
911
- var secondNode = getTerm(y, (m * 2)) // 返回当月「节」为几日开始
881
+ }
912
882
 
913
-
883
+ if (offset < 0) {
914
884
 
915
- // 依据12节气修正干支月
885
+ offset += temp; --i
916
886
 
917
- var gzM = toGanZhi((y - 1900) * 12 + m + 11)
887
+ }
918
888
 
919
- if (d >= firstNode) {
889
+ // 农历月
920
890
 
921
- gzM = toGanZhi((y - 1900) * 12 + m + 12)
891
+ var month = i
922
892
 
923
- }
893
+ // 农历日
924
894
 
925
- // 传入的日期的节气与否
895
+ var day = offset + 1
926
896
 
927
- var isTerm = false
897
+ // 天干地支处理
928
898
 
929
- var Term = null
899
+ var sm = m - 1
930
900
 
931
- if (firstNode === d) {
901
+ var gzY = toGanZhiYear(year)
932
902
 
933
- isTerm = true
934
903
 
935
- Term = solarTerm[m * 2 - 2]
936
904
 
937
- }
905
+ // 当月的两个节气
938
906
 
939
- if (secondNode === d) {
907
+ // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
940
908
 
941
- isTerm = true
909
+ var firstNode = getTerm(y, (m * 2 - 1)) // 返回当月「节」为几日开始
942
910
 
943
- Term = solarTerm[m * 2 - 1]
911
+ var secondNode = getTerm(y, (m * 2)) // 返回当月「节」为几日开始
944
912
 
945
- }
946
913
 
947
- // 日柱 当月一日与 1900/1/1 相差天数
948
914
 
949
- var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10
915
+ // 依据12节气修正干支月
950
916
 
951
- var gzD = toGanZhi(dayCyclical + d - 1)
917
+ var gzM = toGanZhi((y - 1900) * 12 + m + 11)
952
918
 
953
- // 该日期所属的星座
919
+ if (d >= firstNode) {
954
920
 
955
- var astro = toAstro(m, d)
921
+ gzM = toGanZhi((y - 1900) * 12 + m + 12)
956
922
 
957
- return {'lYear': year, 'lMonth': month, 'lDay': day, 'Animal': getAnimal(year), 'IMonthCn': (isLeap ? '\u95f0' : '') + toChinaMonth(month), 'IDayCn': toChinaDay(day), 'cYear': y, 'cMonth': m, 'cDay': d, 'gzYear': gzY, 'gzMonth': gzM, 'gzDay': gzD, 'isToday': isToday, 'isLeap': isLeap, 'nWeek': nWeek, 'ncWeek': '\u661f\u671f' + cWeek, 'isTerm': isTerm, 'Term': Term, 'astro': astro}
923
+ }
924
+
925
+ // 传入的日期的节气与否
926
+
927
+ var isTerm = false
928
+
929
+ var Term = null
930
+
931
+ if (firstNode === d) {
932
+
933
+ isTerm = true
934
+
935
+ Term = solarTerm[m * 2 - 2]
958
936
 
959
937
  }
960
938
 
961
-
939
+ if (secondNode === d) {
962
940
 
963
-
941
+ isTerm = true
964
942
 
965
- var calendarFormatter= {
943
+ Term = solarTerm[m * 2 - 1]
966
944
 
967
- // 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
945
+ }
968
946
 
969
- solar2lunar:function(y, m, d){ // 参数区间1900.1.31~2100.12.31
947
+ // 日柱 当月一日与 1900/1/1 相差天数
970
948
 
971
- return solar2lunar(y, m, d)
949
+ var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10
972
950
 
973
- },
951
+ var gzD = toGanZhi(dayCyclical + d - 1)
974
952
 
975
- /**
953
+ // 该日期所属的星座
976
954
 
977
- * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
955
+ var astro = toAstro(m, d)
978
956
 
979
- * @param y lunar year
957
+ return { 'lYear': year, 'lMonth': month, 'lDay': day, 'Animal': getAnimal(year), 'IMonthCn': (isLeap ? '\u95f0' : '') + toChinaMonth(month), 'IDayCn': toChinaDay(day), 'cYear': y, 'cMonth': m, 'cDay': d, 'gzYear': gzY, 'gzMonth': gzM, 'gzDay': gzD, 'isToday': isToday, 'isLeap': isLeap, 'nWeek': nWeek, 'ncWeek': '\u661f\u671f' + cWeek, 'isTerm': isTerm, 'Term': Term, 'astro': astro }
980
958
 
981
- * @param m lunar month
959
+ }
982
960
 
983
- * @param d lunar day
984
961
 
985
- * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
986
962
 
987
- * @return JSON object
988
963
 
989
- * @eg:console.log(calendar.lunar2solar(1987,9,10));
990
964
 
991
- */
965
+ var calendarFormatter = {
992
966
 
993
- lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1
967
+ // 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
994
968
 
995
- isLeapMonth = !!isLeapMonth
969
+ solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31
996
970
 
997
- if (isLeapMonth && (leapMonth !== m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
971
+ return solar2lunar(y, m, d)
998
972
 
999
- if (y === 2100 && m === 12 && d > 1 || y === 1900 && m === 1 && d < 31) { return -1 } // 超出了最大极限值
973
+ },
1000
974
 
1001
- var day = monthDays(y, m)
975
+ /**
1002
976
 
1003
- var _day = day
977
+ * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
1004
978
 
1005
- // bugFix 2016-9-25
979
+ * @param y lunar year
1006
980
 
1007
- // if month is leap, _day use leapDays method
981
+ * @param m lunar month
1008
982
 
1009
- if (isLeapMonth) {
983
+ * @param d lunar day
1010
984
 
1011
- _day = leapDays(y, m)
985
+ * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
1012
986
 
1013
- }
987
+ * @return JSON object
1014
988
 
1015
- if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验
989
+ * @eg:console.log(calendar.lunar2solar(1987,9,10));
1016
990
 
1017
-
991
+ */
1018
992
 
1019
- // 计算农历的时间差
993
+ lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1
1020
994
 
1021
- var offset = 0
995
+ isLeapMonth = !!isLeapMonth
1022
996
 
1023
- for (var i = 1900; i < y; i++) {
997
+ if (isLeapMonth && (leapMonth !== m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
1024
998
 
1025
- offset += lYearDays(i)
999
+ if (y === 2100 && m === 12 && d > 1 || y === 1900 && m === 1 && d < 31) { return -1 } // 超出了最大极限值
1026
1000
 
1027
- }
1001
+ var day = monthDays(y, m)
1028
1002
 
1029
- var leap = 0
1003
+ var _day = day
1030
1004
 
1031
- var isAdd = false
1005
+ // bugFix 2016-9-25
1032
1006
 
1033
- for (i = 1; i < m; i++) {
1007
+ // if month is leap, _day use leapDays method
1034
1008
 
1035
- leap = leapMonth(y)
1009
+ if (isLeapMonth) {
1036
1010
 
1037
- if (!isAdd) { // 处理闰月
1011
+ _day = leapDays(y, m)
1038
1012
 
1039
- if (leap <= i && leap > 0) {
1013
+ }
1040
1014
 
1041
- offset += leapDays(y); isAdd = true
1015
+ if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验
1042
1016
 
1043
- }
1044
1017
 
1045
- }
1046
1018
 
1047
- offset += monthDays(y, i)
1019
+ // 计算农历的时间差
1048
1020
 
1049
- }
1021
+ var offset = 0
1050
1022
 
1051
- // 转换闰月农历 需补充该年闰月的前一个月的时差
1023
+ for (var i = 1900; i < y; i++) {
1052
1024
 
1053
- if (isLeapMonth) { offset += day }
1025
+ offset += lYearDays(i)
1054
1026
 
1055
- // 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
1027
+ }
1028
+
1029
+ var leap = 0
1056
1030
 
1057
- var stmap = Date.UTC(1900, 1, 30, 0, 0, 0)
1031
+ var isAdd = false
1058
1032
 
1059
- var calObj = new Date((offset + d - 31) * 86400000 + stmap)
1033
+ for (i = 1; i < m; i++) {
1060
1034
 
1061
- var cY = calObj.getUTCFullYear()
1035
+ leap = leapMonth(y)
1062
1036
 
1063
- var cM = calObj.getUTCMonth() + 1
1037
+ if (!isAdd) { // 处理闰月
1064
1038
 
1065
- var cD = calObj.getUTCDate()
1039
+ if (leap <= i && leap > 0) {
1066
1040
 
1067
- return solar2lunar(cY, cM, cD)
1041
+ offset += leapDays(y); isAdd = true
1042
+
1043
+ }
1068
1044
 
1069
1045
  }
1070
1046
 
1071
- }
1047
+ offset += monthDays(y, i)
1048
+
1049
+ }
1050
+
1051
+ // 转换闰月农历 需补充该年闰月的前一个月的时差
1052
+
1053
+ if (isLeapMonth) { offset += day }
1054
+
1055
+ // 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
1056
+
1057
+ var stmap = Date.UTC(1900, 1, 30, 0, 0, 0)
1058
+
1059
+ var calObj = new Date((offset + d - 31) * 86400000 + stmap)
1060
+
1061
+ var cY = calObj.getUTCFullYear()
1062
+
1063
+ var cM = calObj.getUTCMonth() + 1
1064
+
1065
+ var cD = calObj.getUTCDate()
1066
+
1067
+ return solar2lunar(cY, cM, cD)
1068
+
1069
+ }
1070
+
1071
+ }