diff --git a/CHANGELOG.md b/CHANGELOG.md index a1d2b2f..c712e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ - 🛠️ 修复(fix) - 🧹 琐事(Chore) +## v2.3.1 + +- 🛠️ 修复(fix) + + 🇨🇳 + + - 修复小限年龄判断条件错误 + + 🇺🇸 + + - fix age error + ## v2.3.0 - 🪄 功能(feature) diff --git a/package.json b/package.json index 984482f..ca15d39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iztro", - "version": "2.3.0", + "version": "2.3.1", "description": "轻量级紫微斗数星盘生成库。可以通过出生年月日获取到紫微斗数星盘信息、生肖、星座等信息。A lightweight kit to astrolabe generator of The Purple Star Astrology (Zi Wei Dou Shu). The Purple Star Astrology(Zi Wei Dou Shu) is a Chinese ancient astrology. You're able to get your horoscope and personality from the astrolabe", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/astro/FunctionalAstrolabe.ts b/src/astro/FunctionalAstrolabe.ts index 0b9ab7f..e5a0116 100644 --- a/src/astro/FunctionalAstrolabe.ts +++ b/src/astro/FunctionalAstrolabe.ts @@ -45,9 +45,10 @@ const _getHoroscopeBySolarDate = ( // 比如 2022年九月初一 出生的人,在出生后虚岁为 1 岁 // 但在 2023年九月初二 以后,虚岁则为 2 岁 if ( - ((_date.lunarYear === _birthday.lunarYear && _date.lunarMonth) === _birthday.lunarMonth && + (_date.lunarYear === _birthday.lunarYear && + _date.lunarMonth === _birthday.lunarMonth && _date.lunarDay > _birthday.lunarDay) || - _date.lunarMonth > _birthday.lunarMonth + (_date.lunarYear === _birthday.lunarYear && _date.lunarMonth > _birthday.lunarMonth) ) { nominalAge += 1; }