List tasks feature #4

Merged
javier merged 6 commits from app/list-tasks into main 2026-02-10 15:31:53 +00:00
Showing only changes of commit a9f10fbf20 - Show all commits
@@ -37,48 +37,45 @@ struct SampleTaskDataModifier: PreviewModifier {
)
let calendar: Calendar = .current
let today: Date = .now
let tomorrow: Date = calendar.date(byAdding: .day, value: 1, to: today) ?? today
let yesterday = calendar.date(byAdding: .day, value: -1, to: today) ?? today
let tasks: [Todo] = [
.init(
title: "Today task 1",
due: today
title: "Today task #1",
due: .now
),
.init(
title: "Today task 2",
title: "Today task #2",
note: "This is some random note attached to the task.",
due: today
due: .now
),
.init(
title: "Tomorrow task",
due: tomorrow
due: calendar.date(byAdding: .day, value: 1, to: .now) ?? .now
),
.init(
title: "Next week task",
note: "This is some random note attached to the task.",
due: calendar.date(byAdding: .day, value: 7, to: today) ?? today
due: calendar.date(byAdding: .day, value: 7, to: .now) ?? .now
),
.init(
title: "Yesterday task",
due: yesterday
due: calendar.date(byAdding: .day, value: -1, to: .now) ?? .now
),
.init(
title: "Last week task",
note: "This is some random note attached to the task.",
due: calendar.date(byAdding: .day, value: -7, to: today) ?? today
due: calendar.date(byAdding: .day, value: -7, to: .now) ?? .now
),
.init(
title: "Completed task 1",
due: today,
completed: today
title: "Completed task #1",
due: calendar.date(byAdding: .day, value: 1, to: .now) ?? .now,
completed: .now
),
.init(
title: "Completed task 2",
title: "Completed task #2",
note: "This is some random note attached to the task.",
due: yesterday,
completed: today
due: calendar.date(byAdding: .day, value: -1, to: .now) ?? .now,
completed: .now
),
]