v1.2.35 修复物候的错误。
This commit is contained in:
@@ -83,3 +83,15 @@ test('test14', () => {
|
||||
const lunar = solar.getLunar();
|
||||
expect(lunar.getHou()).toBe('立夏 三候');
|
||||
});
|
||||
|
||||
test('test15', () => {
|
||||
const solar = Solar.fromYmd(2022, 8, 22);
|
||||
const lunar = solar.getLunar();
|
||||
expect(lunar.getWuHou()).toBe('寒蝉鸣');
|
||||
});
|
||||
|
||||
test('test16', () => {
|
||||
const solar = Solar.fromYmd(2022, 8, 23);
|
||||
const lunar = solar.getLunar();
|
||||
expect(lunar.getWuHou()).toBe('鹰乃祭鸟');
|
||||
});
|
||||
|
||||
6
lunar.js
6
lunar.js
@@ -1682,7 +1682,11 @@
|
||||
var startSolar = jieQi.getSolar();
|
||||
var startCalendar = ExactDate.fromYmd(startSolar.getYear(),startSolar.getMonth(),startSolar.getDay());
|
||||
var days = ExactDate.getDaysBetween(startCalendar, currentCalendar);
|
||||
return LunarUtil.WU_HOU[(offset*3+Math.floor(days/5)) % LunarUtil.WU_HOU.length];
|
||||
var index = Math.floor(days / 5);
|
||||
if (index > 2) {
|
||||
index = 2;
|
||||
}
|
||||
return LunarUtil.WU_HOU[(offset * 3 + index) % LunarUtil.WU_HOU.length];
|
||||
},
|
||||
getHou:function(){
|
||||
var jieQi = this.getPrevJieQi(true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lunar-javascript",
|
||||
"version": "1.2.34",
|
||||
"version": "1.2.35",
|
||||
"description": "lunar is a calendar library for Solar and Chinese Lunar.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user