import SwiftUI public struct CalendarSettingsView: View { @AppStorage("calendar.timeZoneOverride") private var override = "" @AppStorage("calendar.showMenuBar") private var showMenuBar = true public init() {} public var body: some View { Form { #if os(macOS) Section { Toggle("Show calendar in menu bar", isOn: $showMenuBar) } #endif Section { Toggle("Use system time zone", isOn: Binding( get: { override.isEmpty }, set: { override = $0 ? "" : TimeZone.current.identifier })) if override.isEmpty { LabeledContent("Time zone", value: TimeZone.current.identifier.replacingOccurrences(of: "_", with: " ")) } else { Picker("Time zone", selection: $override) { ForEach(Array(Set(TimeZone.knownTimeZoneIdentifiers + ["UTC", TimeZone.current.identifier])).sorted(), id: \.self) { zone in Text(zone.replacingOccurrences(of: "_", with: " ")).tag(zone) } } } } footer: { Text("Used for your agenda, new events and quick-add on this device. Existing events keep their original time zones.") } }.formStyle(.grouped).navigationTitle("Calendar settings") #if os(macOS) .frame(width: 460, height: 300) #endif } }