Skip to content

Add configurable week start day (Monday/Sunday)#7

Merged
thillygooth merged 1 commit into
thillygooth:mainfrom
CarelvanHeerden:feat/week-start-day-config
May 28, 2026
Merged

Add configurable week start day (Monday/Sunday)#7
thillygooth merged 1 commit into
thillygooth:mainfrom
CarelvanHeerden:feat/week-start-day-config

Conversation

@CarelvanHeerden

Copy link
Copy Markdown

Summary

Adds a configurable week start day setting (Monday or Sunday), defaulting to Monday for European users.

Changes

frontend/src/logic.js

  • weekKey() now accepts an optional weekStartDay parameter (0=Sunday, 1=Monday, default 1)
  • Uses modular arithmetic (dow - weekStartDay + 7) % 7 to calculate the correct week boundary

frontend/src/App.jsx

  • applyAutoResets() passes weekStartDay from config to weekKey()
  • All callers of applyAutoResets() pass config.weekStartDay ?? 1

frontend/src/components/SetupWizard.jsx

  • Added Monday/Sunday toggle in the Display tab (edit mode)
  • Added Monday/Sunday toggle in the initial setup wizard (step 4)
  • weekStartDay is saved to config and persisted via /config endpoint

questboard/DOCS.md

  • Updated the Resets table to note weekly reset is configurable
  • Added Week Start Day section explaining the setting

Backward Compatibility

  • Default is 1 (Monday), so existing configs without weekStartDay will use Monday
  • No migration needed - the field is simply absent from old configs and defaults apply

Adds a config option 'weekStartDay' (0=Sunday, 1=Monday, default 1).
Controls when weekly chores reset and weekly gold leaderboard resets.

Changes:
- logic.js: weekKey() accepts weekStartDay parameter
- App.jsx: passes weekStartDay to applyAutoResets and weekKey calls
- SetupWizard.jsx: Monday/Sunday toggle in Settings -> Display and
  during initial setup wizard

Defaults to Monday (European convention).
@CarelvanHeerden CarelvanHeerden force-pushed the feat/week-start-day-config branch from fa3eb48 to 1106e35 Compare May 28, 2026 16:26
@thillygooth thillygooth merged commit 65397f7 into thillygooth:main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants