File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ private struct ShowLists: ParsableCommand {
19
19
private struct ShowAll : ParsableCommand {
20
20
static let configuration = CommandConfiguration (
21
21
abstract: " Print all reminders " )
22
-
22
+
23
23
@Flag ( help: " Show completed items only " )
24
24
var onlyCompleted = false
25
25
@@ -42,15 +42,15 @@ private struct ShowAll: ParsableCommand {
42
42
" Cannot specify both --show-completed and --only-completed " )
43
43
}
44
44
}
45
-
45
+
46
46
func run( ) {
47
47
var displayOptions = DisplayOptions . incomplete
48
48
if self . onlyCompleted {
49
49
displayOptions = . complete
50
50
} else if self . includeCompleted {
51
51
displayOptions = . all
52
52
}
53
-
53
+
54
54
reminders. showAllReminders (
55
55
dueOn: self . dueDate, displayOptions: displayOptions, outputFormat: format)
56
56
}
@@ -151,7 +151,7 @@ private struct Add: ParsableCommand {
151
151
string: self . reminder. joined ( separator: " " ) ,
152
152
notes: self . notes,
153
153
toListNamed: self . listName,
154
- dueDate : self . dueDate,
154
+ dueDateComponents : self . dueDate,
155
155
priority: priority,
156
156
outputFormat: format)
157
157
}
Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ public final class Reminders {
305
305
string: String ,
306
306
notes: String ? ,
307
307
toListNamed name: String ,
308
- dueDate : DateComponents ? ,
308
+ dueDateComponents : DateComponents ? ,
309
309
priority: Priority ,
310
310
outputFormat: OutputFormat )
311
311
{
@@ -314,8 +314,11 @@ public final class Reminders {
314
314
reminder. calendar = calendar
315
315
reminder. title = string
316
316
reminder. notes = notes
317
- reminder. dueDateComponents = dueDate
317
+ reminder. dueDateComponents = dueDateComponents
318
318
reminder. priority = Int ( priority. value. rawValue)
319
+ if let dueDate = dueDateComponents? . date {
320
+ reminder. addAlarm ( EKAlarm ( absoluteDate: dueDate) )
321
+ }
319
322
320
323
do {
321
324
try Store . save ( reminder, commit: true )
You can’t perform that action at this time.
0 commit comments