mirror of
https://github.com/ellite/Wallos.git
synced 2026-08-01 10:46:06 -04:00
* 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>
11 lines
459 B
PHP
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');
|
|
}
|