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

rely on configuration service to display first day of week in calendar

ulfertsc45bb9277a71
diff --git a/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.component.ts
index 0e132a0385a..8e9da09ab69 100644
--- a/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.component.ts
@@ -19,6 +19,7 @@ import { EventInput, EventApi } from '@fullcalendar/core';
import { EventSourceError } from '@fullcalendar/core/structs/event-source';
import { take } from 'rxjs/operators';
import { ToolbarInput } from '@fullcalendar/core/types/input-types';
+import {ConfigurationService} from "core-app/modules/common/config/configuration.service";
interface CalendarViewEvent {
el:HTMLElement;
@@ -56,7 +57,8 @@ export class WorkPackagesCalendarController implements OnInit, OnDestroy, AfterV
private element:ElementRef,
readonly i18n:I18nService,
readonly notificationsService:NotificationsService,
- private sanitizer:DomSanitizer) { }
+ private sanitizer:DomSanitizer,
+ private configuration:ConfigurationService) { }
ngOnInit() {
// Clear any old subscribers
@@ -187,6 +189,10 @@ export class WorkPackagesCalendarController implements OnInit, OnDestroy, AfterV
}
}
+ public get calendarFirstDay() {
+ return this.configuration.startOfWeek();
+ }
+
private get calendarElement() {
return jQuery(this.element.nativeElement).find('.fc-view-container');
}
diff --git a/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.template.html b/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.template.html
index d60b58142cd..6f8b9a28557 100644
--- a/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.template.html
+++ b/frontend/src/app/modules/calendar/wp-calendar/wp-calendar.template.html
@@ -10,6 +10,7 @@
[height]="calendarHeight"
[header]="calendarHeader"
[defaultView]="calendarDefaultView"
+ [firstDay]="calendarFirstDay"
[events]="calendarEvents"
[plugins]="calendarPlugins">
</full-calendar>