Improved the quality of sample data for the SampleTaskDataModifier preview modifier in the app target.

This commit is contained in:
2026-02-10 10:10:13 +01:00
parent 1169d8c622
commit a9f10fbf20
@@ -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
),
]