1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 04:42:05 -04:00

feat: add setting for first day of the week (#1854)

* feat: add setting for first day of the week

* fix: extract settings indices

* fix: formatting mistake

* fix(ui): add outline rectangle between settings and reorder settings

* fix: don't set firstDayOfWeek automatically to system's locale
This commit is contained in:
Jonas Bloch
2026-03-01 02:37:16 +01:00
committed by GitHub
parent 20d383d4ab
commit ee1a2bc7de
5 changed files with 179 additions and 46 deletions

View File

@@ -14,8 +14,15 @@ Rectangle {
signal closeDash
function weekStartQt() {
if (SettingsData.firstDayOfWeek >= 7 || SettingsData.firstDayOfWeek < 0) {
return Qt.locale().firstDayOfWeek;
}
return SettingsData.firstDayOfWeek;
}
function weekStartJs() {
return Qt.locale().firstDayOfWeek % 7;
return weekStartQt() % 7;
}
function startOfWeek(dateObj) {
@@ -223,7 +230,7 @@ Rectangle {
Repeater {
model: {
const days = [];
const qtFirst = Qt.locale().firstDayOfWeek;
const qtFirst = weekStartQt();
for (let i = 0; i < 7; ++i) {
const qtDay = ((qtFirst - 1 + i) % 7) + 1;
days.push(I18n.locale().dayName(qtDay, Locale.ShortFormat));