diff --git a/src/public/app/widgets/buttons/calendar.js b/src/public/app/widgets/buttons/calendar.js
index 21792fc25..19822a228 100644
--- a/src/public/app/widgets/buttons/calendar.js
+++ b/src/public/app/widgets/buttons/calendar.js
@@ -206,4 +206,11 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
this.$monthSelect.val(this.date.getMonth());
this.$yearSelect.val(this.date.getFullYear());
}
+
+ async entitiesReloadedEvent({loadResults}) {
+ if (loadResults.getOptionNames().includes("firstDayOfWeek")) {
+ this.init();
+ }
+ }
+
}
diff --git a/src/public/app/widgets/type_widgets/options/appearance/i18n.js b/src/public/app/widgets/type_widgets/options/appearance/i18n.js
index 0c79ac94c..2137cd26a 100644
--- a/src/public/app/widgets/type_widgets/options/appearance/i18n.js
+++ b/src/public/app/widgets/type_widgets/options/appearance/i18n.js
@@ -12,6 +12,14 @@ const TPL = `
+
+
+
+
+
`;
@@ -19,12 +27,18 @@ const TPL = `
export default class LocalizationOptions extends OptionsWidget {
doRender() {
this.$widget = $(TPL);
+
this.$localeSelect = this.$widget.find(".locale-select");
this.$localeSelect.on("change", async() => {
const newLocale = this.$localeSelect.val();
await server.put(`options/locale/${newLocale}`);
utils.reloadFrontendApp("locale change");
});
+
+ this.$firstDayOfWeek = this.$widget.find(".first-day-of-week-select");
+ this.$firstDayOfWeek.on("change", () => {
+ this.updateOption("firstDayOfWeek", this.$firstDayOfWeek.val());
+ });
}
async optionsLoaded(options) {
@@ -38,5 +52,6 @@ export default class LocalizationOptions extends OptionsWidget {
}
this.$localeSelect.val(options.locale);
+ this.$firstDayOfWeek.val(options.firstDayOfWeek);
}
}
\ No newline at end of file
diff --git a/src/routes/api/options.ts b/src/routes/api/options.ts
index 965540432..05e7355fa 100644
--- a/src/routes/api/options.ts
+++ b/src/routes/api/options.ts
@@ -59,7 +59,8 @@ const ALLOWED_OPTIONS = new Set([
'customSearchEngineUrl',
'promotedAttributesOpenInRibbon',
'editedNotesOpenInRibbon',
- 'locale'
+ 'locale',
+ 'firstDayOfWeek'
]);
function getOptions() {
diff --git a/src/services/options_init.ts b/src/services/options_init.ts
index 111e78cd4..2adbadd2b 100644
--- a/src/services/options_init.ts
+++ b/src/services/options_init.ts
@@ -95,7 +95,10 @@ const defaultOptions: DefaultOption[] = [
{ name: 'customSearchEngineUrl', value: 'https://duckduckgo.com/?q={keyword}', isSynced: true },
{ name: 'promotedAttributesOpenInRibbon', value: 'true', isSynced: true },
{ name: 'editedNotesOpenInRibbon', value: 'true', isSynced: true },
- { name: 'locale', value: 'en', isSynced: true }
+
+ // Internationalization
+ { name: 'locale', value: 'en', isSynced: true },
+ { name: 'firstDayOfWeek', value: '1', isSynced: true }
];
function initStartupOptions() {