PeerTube

Screen Recording - Add optional week-aligned calendar view with selectable week start (#538) #1330


Listen Later

Adds an opt-in weekly view for the mini calendar that shows one week at a time, aligned to a user-chosen first weekday — addressing the request in #538 to control which day the week starts on.

The existing scrolling day dial remains the default, so current behaviour is unchanged unless the user opts in.

What's new

Settings → Calendar → "Weekly view" toggle. When on, the calendar shows a fixed 7-day strip starting on the chosen weekday, with ‹ › chevrons; the scroll wheel and chevrons page a whole week.

"Week starts on" picker (System default / Sunday / Monday), shown only when Weekly view is enabled.
Implementation notes

New WeekStartDay enum (firstWeekday resolved via Calendar.firstWeekday; system follows the OS) and two defaults: calendarWeekView (Bool, default false) and weekStartDay (default .system).

New WeekStripPicker view; CalendarView switches between the original dial and the week strip on the toggle. The dial code path is unchanged.
Weekday symbols use the locale-aware Calendar.veryShortWeekdaySymbols; week boundaries use Calendar.dateInterval(of: .weekOfYear:) so they honour firstWeekday and are DST-safe.
Option labels are keyed by their English text so untranslated locales fall back to readable English rather than raw string keys.
While here, tidied the scroll-wheel NSEvent local-monitor lifecycle in both pickers (store the token, remove it on .onDisappear) — the dial previously added a monitor on every appear without removing it.
Testing

Builds clean (xcodebuild, Debug, macOS).

Verified on a real notch: default dial unchanged; toggling Weekly view switches live; Sunday/Monday/System re-align the strip; wheel + chevrons page exactly one week; selecting a day updates the event list.

...more
View all episodesView all episodes
Download on the App Store

PeerTubeBy