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 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] = [ let tasks: [Todo] = [
.init( .init(
title: "Today task 1", title: "Today task #1",
due: today due: .now
), ),
.init( .init(
title: "Today task 2", title: "Today task #2",
note: "This is some random note attached to the task.", note: "This is some random note attached to the task.",
due: today due: .now
), ),
.init( .init(
title: "Tomorrow task", title: "Tomorrow task",
due: tomorrow due: calendar.date(byAdding: .day, value: 1, to: .now) ?? .now
), ),
.init( .init(
title: "Next week task", title: "Next week task",
note: "This is some random note attached to the 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( .init(
title: "Yesterday task", title: "Yesterday task",
due: yesterday due: calendar.date(byAdding: .day, value: -1, to: .now) ?? .now
), ),
.init( .init(
title: "Last week task", title: "Last week task",
note: "This is some random note attached to the 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( .init(
title: "Completed task 1", title: "Completed task #1",
due: today, due: calendar.date(byAdding: .day, value: 1, to: .now) ?? .now,
completed: today completed: .now
), ),
.init( .init(
title: "Completed task 2", title: "Completed task #2",
note: "This is some random note attached to the task.", note: "This is some random note attached to the task.",
due: yesterday, due: calendar.date(byAdding: .day, value: -1, to: .now) ?? .now,
completed: today completed: .now
), ),
] ]