Skip to content

feat: Allow setting beginning of week as Sunday in calendar#1010

Draft
Duckiduc wants to merge 1 commit intoellite:mainfrom
Duckiduc:feature/week-start-sunday-setting
Draft

feat: Allow setting beginning of week as Sunday in calendar#1010
Duckiduc wants to merge 1 commit intoellite:mainfrom
Duckiduc:feature/week-start-sunday-setting

Conversation

@Duckiduc
Copy link
Copy Markdown

Summary

Adds a user setting to start the calendar week on Sunday instead of Monday.

Changes

  • Migration (migrations/000045.php): Adds week_starts_sunday boolean column to the settings table, defaulting to 0 (Monday-first) for all existing users.
  • Settings UI (settings.php): Adds a checkbox under Display Settings → Experience to toggle the preference.
  • Settings endpoint (endpoints/settings/week_starts_sunday.php): Persists the preference to the database.
  • Calendar (calendar.php): Rotates the weekday header and leading empty cells based on the saved preference.
  • i18n (includes/i18n/en.php): Adds the week_starts_on_sunday translation key.
  • New user defaults (registration.php, endpoints/admin/adduser.php, includes/oidc/oidc_create_user.php): Includes the new column in all INSERT INTO settings statements.
  • Settings loader (includes/getsettings.php): Normalises the value with a safe fallback for rows that predate the migration.

Behaviour

  • Default is Monday-first (no change for existing users).
  • When enabled, the calendar header shows Sun–Sat and the first-day offset is recalculated accordingly.

Testing

  • Run migrations on an existing database and verify week_starts_sunday column is added.
  • Toggle the setting and confirm the calendar header and day-alignment update correctly for both Monday-first and Sunday-first.
  • Register a new user and confirm the setting defaults to Monday-first.

Closes #1001

- Implemented a new endpoint to update the week_starts_sunday setting.
- Modified the settings retrieval to include week_starts_sunday.
- Added translation for the week_starts_sunday label.
- Updated user creation to include week_starts_sunday in the settings.
- Created a migration to add week_starts_sunday column to the settings table.
- Updated registration and settings scripts to handle week_starts_sunday.
- Added a checkbox in the settings UI for users to set their preference for the week starting on Sunday.
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.

Request - Allow setting beginning of week as Sunday instead of Monday

1 participant