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

fix te calendar scale adaptation

ulfertscf96e4a4eeb6
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
index 7b6904970ca..4318b4800ee 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
@@ -202,7 +202,13 @@ export class TimeEntryCalendarComponent implements OnInit, AfterViewInit {
}
if (oldRatio !== this.scaleRatio) {
- this.ucCalendar.getApi().render();
+ // This is a hack.
+ // We already set the same function (different object) via angular.
+ // But it will trigger repainting the calendar.
+ // Weirdly, this.ucCalendar.getApi().rerender() does not.
+ this.ucCalendar.getApi().setOption('slotLabelFormat', (info:any) => {
+ return (this.maxHour - info.date.hour) / this.scaleRatio;
+ });
}
}