feat(timeline): TimelineRow + DateSection + grouping tests + Diary sheet

- TimelineRow: 时间线条目单行视图
- DateSection + TimelineGrouping: 今日/昨日/本周/更早分组
- DiaryQuickSheet: 文字日记快速记录入口
- TimelineGroupingTests: 分组逻辑烟测
- SymptomEndSheet / RootView: 配套微调
This commit is contained in:
link2026
2026-05-25 23:23:21 +08:00
parent b1b8d0a8c7
commit b63b26bce5
6 changed files with 337 additions and 14 deletions

View File

@@ -104,16 +104,3 @@ struct SymptomEndSheet: View {
}
}
func formatDuration(_ interval: TimeInterval) -> String {
let totalMinutes = Int(interval / 60)
let days = totalMinutes / (60 * 24)
let hours = (totalMinutes % (60 * 24)) / 60
let minutes = totalMinutes % 60
if days > 0 && hours > 0 { return "\(days)\(hours) 小时" }
if days > 0 { return "\(days)" }
if hours > 0 && minutes > 0 { return "\(hours) 小时 \(minutes)" }
if hours > 0 { return "\(hours) 小时" }
if minutes > 0 { return "\(minutes) 分钟" }
return "刚刚"
}