List tasks feature (#4)
This PR contains the work done to implement the **List Tasks** feature, and to integrate it into the main content view of the app. Reviewed-on: rock-n-code/todos-app#4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #4.
This commit is contained in:
@@ -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
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user