Add localization (DE/EN), vertical-scroll month view, context menus, custom colors
- Vertical-scroll month view with multi-day event spans, zig-zag month divider, CW number per week, on-demand event loading while scrolling - Top bar redesign: icon-only view picker on right, month title centered - Long-press context menus on day cells (month) and hour slots (week/day) for "New event", "Open in week view", "Open in day view", "Open in month view" - Localization system with system/de/en switch covering top bar, view picker, settings, menu, profile, server, accounts, event editor, agenda - Three new color pickers (text/background/line) + today-marker color applied in calendar views; current-time line now uses today color - App icon: removed alpha channel, accent color set to icon green (#20A050) - TestFlight: ITSAppUsesNonExemptEncryption=NO baked into Info.plist keys Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import SwiftUI
|
||||
struct AgendaView: View {
|
||||
let store: CalendarStore
|
||||
let onEventTap: (CalEvent) -> Void
|
||||
@AppStorage("appLanguage") private var appLang = "system"
|
||||
|
||||
private var cal: Calendar { store.userCalendar }
|
||||
|
||||
@@ -17,25 +18,27 @@ struct AgendaView: View {
|
||||
return dict.keys.sorted().map { ($0, dict[$0]!.sorted { $0.startDate < $1.startDate }) }
|
||||
}
|
||||
|
||||
private let dayFmt: DateFormatter = {
|
||||
private var dayFmt: DateFormatter {
|
||||
let f = DateFormatter()
|
||||
f.locale = L10n.locale(appLang)
|
||||
f.dateFormat = "EEEE, d. MMMM yyyy"
|
||||
return f
|
||||
}()
|
||||
}
|
||||
|
||||
private let timeFmt: DateFormatter = {
|
||||
private var timeFmt: DateFormatter {
|
||||
let f = DateFormatter()
|
||||
f.locale = L10n.locale(appLang)
|
||||
f.timeStyle = .short
|
||||
f.dateStyle = .none
|
||||
return f
|
||||
}()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if grouped.isEmpty {
|
||||
ContentUnavailableView(
|
||||
"Keine Termine",
|
||||
L10n.t("cal.no_events_title", appLang),
|
||||
systemImage: "calendar",
|
||||
description: Text("In den nächsten 90 Tagen sind keine Termine vorhanden.")
|
||||
description: Text(L10n.t("cal.no_events_body", appLang))
|
||||
)
|
||||
} else {
|
||||
List {
|
||||
@@ -43,7 +46,7 @@ struct AgendaView: View {
|
||||
Section {
|
||||
ForEach(evs) { ev in
|
||||
Button { onEventTap(ev) } label: {
|
||||
AgendaEventRow(event: ev, timeFmt: timeFmt)
|
||||
AgendaEventRow(event: ev, timeFmt: timeFmt, allDayLabel: L10n.t("cal.allday", appLang))
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
@@ -62,9 +65,10 @@ struct AgendaView: View {
|
||||
private struct AgendaEventRow: View {
|
||||
let event: CalEvent
|
||||
let timeFmt: DateFormatter
|
||||
let allDayLabel: String
|
||||
|
||||
var timeString: String {
|
||||
if event.isAllDay { return "Ganztägig" }
|
||||
if event.isAllDay { return allDayLabel }
|
||||
return timeFmt.string(from: event.startDate)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user