Skip to content

Commit

Permalink
fix: age error
Browse files Browse the repository at this point in the history
  • Loading branch information
SylarLong committed Mar 11, 2024
1 parent 45a71a6 commit 2483d63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
- 🛠️ 修复(fix)
- 🧹 琐事(Chore)

## v2.3.1

- 🛠️ 修复(fix)

🇨🇳

- 修复小限年龄判断条件错误

🇺🇸

- fix age error

## v2.3.0

- 🪄 功能(feature)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/astro/FunctionalAstrolabe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2483d63

Please sign in to comment.