Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Sources/RemindCore/EventKitStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public actor RemindersStore {
completionDate: reminder.completionDate,
priority: ReminderPriority(eventKitValue: Int(reminder.priority)),
dueDate: date(from: reminder.dueDateComponents),
isFlagged: reminder.isFlagged,
listID: reminder.calendar.calendarIdentifier,
listName: reminder.calendar.title
)
Expand Down Expand Up @@ -153,6 +154,7 @@ public actor RemindersStore {
completionDate: reminder.completionDate,
priority: ReminderPriority(eventKitValue: Int(reminder.priority)),
dueDate: date(from: reminder.dueDateComponents),
isFlagged: reminder.isFlagged,
listID: reminder.calendar.calendarIdentifier,
listName: reminder.calendar.title
)
Expand All @@ -173,6 +175,7 @@ public actor RemindersStore {
completionDate: reminder.completionDate,
priority: ReminderPriority(eventKitValue: Int(reminder.priority)),
dueDate: date(from: reminder.dueDateComponents),
isFlagged: reminder.isFlagged,
listID: reminder.calendar.calendarIdentifier,
listName: reminder.calendar.title
)
Expand Down Expand Up @@ -212,6 +215,7 @@ public actor RemindersStore {
let completionDate: Date?
let priority: Int
let dueDateComponents: DateComponents?
let isFlagged: Bool
let listID: String
let listName: String
}
Expand All @@ -228,6 +232,7 @@ public actor RemindersStore {
completionDate: reminder.completionDate,
priority: Int(reminder.priority),
dueDateComponents: reminder.dueDateComponents,
isFlagged: reminder.isFlagged,
listID: reminder.calendar.calendarIdentifier,
listName: reminder.calendar.title
)
Expand All @@ -245,6 +250,7 @@ public actor RemindersStore {
completionDate: data.completionDate,
priority: ReminderPriority(eventKitValue: data.priority),
dueDate: date(from: data.dueDateComponents),
isFlagged: data.isFlagged,
listID: data.listID,
listName: data.listName
)
Expand Down Expand Up @@ -284,6 +290,7 @@ public actor RemindersStore {
completionDate: reminder.completionDate,
priority: ReminderPriority(eventKitValue: Int(reminder.priority)),
dueDate: date(from: reminder.dueDateComponents),
isFlagged: reminder.isFlagged,
listID: reminder.calendar.calendarIdentifier,
listName: reminder.calendar.title
)
Expand Down
3 changes: 3 additions & 0 deletions Sources/RemindCore/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
public let completionDate: Date?
public let priority: ReminderPriority
public let dueDate: Date?
public let isFlagged: Bool
public let listID: String
public let listName: String

Expand All @@ -62,6 +63,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
completionDate: Date?,
priority: ReminderPriority,
dueDate: Date?,
isFlagged: Bool,
listID: String,
listName: String
) {
Expand All @@ -72,6 +74,7 @@ public struct ReminderItem: Identifiable, Codable, Sendable, Equatable {
self.completionDate = completionDate
self.priority = priority
self.dueDate = dueDate
self.isFlagged = isFlagged
self.listID = listID
self.listName = listName
}
Expand Down
4 changes: 3 additions & 1 deletion Sources/remindctl/OutputFormatting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ enum OutputRenderer {
let status = reminder.isCompleted ? "x" : " "
let due = reminder.dueDate.map { DateParsing.formatDisplay($0) } ?? "no due date"
let priority = reminder.priority == .none ? "" : " priority=\(reminder.priority.rawValue)"
Swift.print("[\(index + 1)] [\(status)] \(reminder.title) [\(reminder.listName)] — \(due)\(priority)")
let flag = reminder.isFlagged ? " ⚑" : ""
Swift.print("[\(index + 1)] [\(status)] \(reminder.title) [\(reminder.listName)] — \(due)\(priority)\(flag)")
}
}

Expand All @@ -116,6 +117,7 @@ enum OutputRenderer {
reminder.listName,
reminder.isCompleted ? "1" : "0",
reminder.priority.rawValue,
reminder.isFlagged ? "1" : "0",
due,
reminder.title,
].joined(separator: "\t")
Expand Down
2 changes: 2 additions & 0 deletions Tests/RemindCoreTests/IDResolverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct IDResolverTests {
completionDate: nil,
priority: .none,
dueDate: Date(timeIntervalSince1970: 1_700_000_000),
isFlagged: false,
listID: "list1",
listName: "Work"
),
Expand All @@ -26,6 +27,7 @@ struct IDResolverTests {
completionDate: nil,
priority: .none,
dueDate: Date(timeIntervalSince1970: 1_700_000_100),
isFlagged: false,
listID: "list1",
listName: "Work"
),
Expand Down
5 changes: 5 additions & 0 deletions Tests/RemindCoreTests/ReminderFilteringTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct ReminderFilteringTests {
completionDate: nil,
priority: .none,
dueDate: yesterday,
isFlagged: false,
listID: "a",
listName: "Home"
),
Expand All @@ -35,6 +36,7 @@ struct ReminderFilteringTests {
completionDate: nil,
priority: .none,
dueDate: today,
isFlagged: false,
listID: "a",
listName: "Home"
),
Expand All @@ -46,6 +48,7 @@ struct ReminderFilteringTests {
completionDate: nil,
priority: .none,
dueDate: tomorrow,
isFlagged: false,
listID: "a",
listName: "Home"
),
Expand All @@ -57,6 +60,7 @@ struct ReminderFilteringTests {
completionDate: nil,
priority: .none,
dueDate: nil,
isFlagged: false,
listID: "a",
listName: "Home"
),
Expand All @@ -68,6 +72,7 @@ struct ReminderFilteringTests {
completionDate: now,
priority: .none,
dueDate: today,
isFlagged: false,
listID: "a",
listName: "Home"
),
Expand Down