Skip to content

Commit ee79d32

Browse files
committed
fix(computer-use): keep seconds in reminder due times
1 parent f815fed commit ee79d32

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/desktop/native/computer-use/ComputerUse.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func dueComponents(_ text: String) throws -> DateComponents {
100100
throw ComputerError("invalid_arguments", "Due must be YYYY-MM-DD or an ISO 8601 date-time.", dispatchState: "not_started")
101101
}
102102
calendar.timeZone = .current
103-
return calendar.dateComponents([.year, .month, .day, .hour, .minute, .timeZone], from: date)
103+
return calendar.dateComponents([.year, .month, .day, .hour, .minute, .second, .timeZone], from: date)
104104
}
105105
/// Reminders or Calendar access as the status reports it, read without prompting.
106106
func eventKitAuthorization(_ type: EKEntityType) -> String {

‎apps/desktop/native/computer-use/tests/NativeTests.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ import AppKit
3838
for bundle in ["com.apple.TextEdit", "com.apple.finder", "com.apple.Safari"] { precondition(!isProtectedApp(bundle), bundle) }
3939
let dateOnly = try dueComponents("2027-05-04")
4040
precondition(dateOnly.year == 2027 && dateOnly.month == 5 && dateOnly.day == 4 && dateOnly.hour == nil)
41-
let timed = try dueComponents("2027-05-04T09:30:00Z")
42-
precondition(timed.hour != nil && timed.minute != nil)
41+
let timed = try dueComponents("2027-05-04T09:30:45Z")
42+
precondition(timed.hour != nil && timed.minute != nil && timed.second == 45)
4343
let localDue = try dueComponents("2027-05-04T09:30")
4444
precondition(localDue.hour == 9 && localDue.minute == 30)
4545
for due in ["2027-02-30", "2027-05-04T25:30:00", "May 4", "2027-5-4"] {

0 commit comments

Comments
 (0)