Week view: relative start-day offset for non-7-day counts; hide week-only settings elsewhere
Build and push server image / build-and-push (push) Successful in 53s
Build and push server image / build-and-push (push) Successful in 53s
calendar_week_start's fixed-weekday anchor ("start on the most recent
Monday") stops making sense once the view isn't a literal calendar
week, so a non-7-day week view now starts calendar_week_start_offset
days from today instead (0 = starts today, negative/positive = past/
future) -- calendar_week_start still governs at the default 7 days,
unchanged.
Also hides the Calendar tab's week-only fields (days to show, layout,
start offset) unless View is actually set to Week, and further hides
the new start-offset field specifically when Days to show is 7 (where
it has no effect). "Week starts on" stays visible for Month too, since
it actually still applies there.
This commit is contained in:
@@ -189,6 +189,16 @@ def _migration_12(conn) -> None:
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_tasks_cached TEXT"))
|
||||
|
||||
|
||||
def _migration_13(conn) -> None:
|
||||
"""A day-count-relative start offset for the week view
|
||||
(calendar_week_start_offset), used instead of calendar_week_start's
|
||||
fixed-weekday anchor once the view isn't a literal 7-day week --
|
||||
"start on the most recent Monday" stops meaning much for e.g. a
|
||||
5-day view. Default 0 (starts today) is a behavior-preserving no-op
|
||||
until someone changes the day count away from 7."""
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_week_start_offset INTEGER NOT NULL DEFAULT 0"))
|
||||
|
||||
|
||||
MIGRATIONS = [
|
||||
(1, _migration_1),
|
||||
(2, _migration_2),
|
||||
@@ -202,6 +212,7 @@ MIGRATIONS = [
|
||||
(10, _migration_10),
|
||||
(11, _migration_11),
|
||||
(12, _migration_12),
|
||||
(13, _migration_13),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user