Skip to content
Open
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
16 changes: 12 additions & 4 deletions Sources/EventKitManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,18 @@ class EventKitManager {
// MARK: - Helper Methods

/// Creates a date formatter that outputs ISO 8601 format in the user's local timezone
private func localDateFormatter() -> DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssXXXXX" // ISO 8601 with timezone offset
formatter.timeZone = TimeZone.current
private func localDateFormatter() -> ISO8601DateFormatter {
let formatter = ISO8601DateFormatter()
formatter.timeZone = .current

formatter.formatOptions = [
.withFullDate,
.withTime,
.withColonSeparatorInTime,
.withTimeZone // Z or ±HHMM
// NOTE: intentionally NOT including .withColonSeparatorInTimeZone or .withInternetDateTime
]

return formatter
}

Expand Down