q78kgblog 0.0.0-1720429643771 → 0.0.0-1720441708496

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