fix: calendar recurrence tz/overrides, today habits schedule, list archive mobile access
ci / docker (push) Successful in 3m23s

This commit is contained in:
2026-09-06 11:33:21 +08:00
parent 0cc486069e
commit 4e888ffe1c
10 changed files with 166 additions and 20 deletions
+10
View File
@@ -33,6 +33,16 @@ export function isHabitComplete(kind: string | undefined, value: number | boolea
return Boolean(value)
}
type HabitSchedule = {
kind?: string
cells?: Array<{ day: string; scheduled?: boolean; paused?: boolean; value?: number | boolean }>
}
export function isHabitScheduledToday(habit: HabitSchedule, day: string) {
const cell = (habit.cells ?? []).find((item) => item.day === day)
return Boolean(cell?.scheduled && !cell.paused)
}
export function nextHabitSwipeValue(kind: string | undefined, current: number | boolean | undefined, target = 1) {
const value = Number(current ?? 0)
if (kind === 'numeric') return Math.min(value + 1, target)