Files
Wallos/migrations/000048.php
Duc-Thomas f01685e0eb feat: Allow setting beginning of week as Sunday in calendar (#1010)
* Add week_starts_sunday setting functionality

- 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.

* fix: validate week_starts_sunday input before reading it

---------

Co-authored-by: Miguel Ribeiro <k.d.mintnick@gmail.com>
2026-07-09 22:00:39 +02:00

11 lines
459 B
PHP

<?php
// This migration adds a "week_starts_sunday" column to the settings table and defaults it to false.
$columnQuery = $db->query("SELECT * FROM pragma_table_info('settings') where name='week_starts_sunday'");
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($columnRequired) {
$db->exec("ALTER TABLE settings ADD COLUMN week_starts_sunday BOOLEAN DEFAULT 0");
$db->exec('UPDATE settings SET `week_starts_sunday` = 0');
}