feat(timeline): TimelineRow + DateSection + grouping tests + Diary sheet
- TimelineRow: 时间线条目单行视图 - DateSection + TimelineGrouping: 今日/昨日/本周/更早分组 - DiaryQuickSheet: 文字日记快速记录入口 - TimelineGroupingTests: 分组逻辑烟测 - SymptomEndSheet / RootView: 配套微调
This commit is contained in:
@@ -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 "刚刚"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user