From ef785a3ca7ee3c125867a06759447f8c3047f482 Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 15 Jun 2026 16:18:38 +0800 Subject: [PATCH] docs: correct tyme4kt API details in birthday crown spec and plan --- docs/superpowers/plans/2026-06-15-birthday-crown.md | 4 ++-- docs/superpowers/specs/2026-06-15-birthday-crown-design.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/superpowers/plans/2026-06-15-birthday-crown.md b/docs/superpowers/plans/2026-06-15-birthday-crown.md index 6b8a4df..4c5f2c5 100644 --- a/docs/superpowers/plans/2026-06-15-birthday-crown.md +++ b/docs/superpowers/plans/2026-06-15-birthday-crown.md @@ -162,7 +162,7 @@ private fun compute(date: LocalDate): DayCellInfo { val lunarMonthName = lunarMonth.getName() val isBirthday = (date.month.number == 9 && date.day == 4) || - (lunarDay.getLunarMonth().getIndexInYear() == 1 && lunarDay.getDay() == 21) + (lunarDay.getLunarMonth().getIndexInYear() == 0 && lunarDay.day == 21) // 农历传统节日(仅当天) val lunarFestival = lunarDay.getFestival() @@ -365,4 +365,4 @@ git commit -m "style: apply spotless formatting" 3. **Type consistency** - `DayCellInfo.isBirthday` 在 Task 2 定义,Task 3 读取。 - `R.drawable.ic_birthday_crown` 在 Task 1 创建,Task 3 引用。 - - tyme4kt API 使用 `getIndexInYear()` 与 `getDay()`,已通过本地 JVM 脚本验证。 + - tyme4kt API 使用 `LunarMonth.getIndexInYear()`(0-based,正月 = 0)与 `LunarDay.day`(Kotlin 属性),已通过本地 JVM 脚本验证。 diff --git a/docs/superpowers/specs/2026-06-15-birthday-crown-design.md b/docs/superpowers/specs/2026-06-15-birthday-crown-design.md index fde2281..867f3da 100644 --- a/docs/superpowers/specs/2026-06-15-birthday-crown-design.md +++ b/docs/superpowers/specs/2026-06-15-birthday-crown-design.md @@ -46,10 +46,10 @@ data class DayCellInfo( ```kotlin val isBirthday = (date.month.number == 9 && date.day == 4) || - (lunarDay.getLunarMonth().getMonthInYear() == 1 && lunarDay.getDayInMonth() == 21) + (lunarDay.getLunarMonth().getIndexInYear() == 0 && lunarDay.day == 21) ``` -> 注意:`tyme4kt` 的 API 名称以实际导入版本为准;若 `getMonthInYear()` / `getDayInMonth()` 名称不同,在实现阶段按实际 API 调整。 +> 注意:`tyme4kt` 中 `LunarMonth.getIndexInYear()` 返回 0-based 索引(正月 = 0),`LunarDay.day` 是 Kotlin 属性,返回农历日。 ## 4. 资源处理