fix te calendar scale adaptation

It probably got broken when migrating to angular 9
pull/8332/head
ulferts 5 years ago
parent b02c0bc299
commit cf96e4a4ee
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 8
      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;
});
}
}

Loading…
Cancel
Save