Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

use moment for start of week calculation

ulferts65420bc156cb
diff --git a/frontend/src/app/modules/common/config/configuration.service.ts b/frontend/src/app/modules/common/config/configuration.service.ts
index 210cc4a9c02..d60884b33a9 100644
--- a/frontend/src/app/modules/common/config/configuration.service.ts
+++ b/frontend/src/app/modules/common/config/configuration.service.ts
@@ -30,6 +30,7 @@ import {Injectable} from '@angular/core';
import {I18nService} from 'core-app/modules/common/i18n/i18n.service';
import {ConfigurationDmService} from "core-app/modules/hal/dm-services/configuration-dm.service";
import {ConfigurationResource} from "core-app/modules/hal/resources/configuration-resource";
+import * as moment from "moment";
@Injectable()
export class ConfigurationService {
@@ -95,14 +96,8 @@ export class ConfigurationService {
public startOfWeek() {
if (this.startOfWeekPresent()) {
return this.systemPreference('startOfWeek');
- } else if (I18n.locale === 'en') {
- return 1;
- } else if (I18n.locale === 'de') {
- // This if/else statement is used because
- // jquery regionals have different start day for German locale
- return 0;
} else {
- return null;
+ return moment.localeData(I18n.locale).firstDayOfWeek();
}
}