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 rendering of dates, which are not to be parsed from utc

Oliver Günther1beab9a61aba
diff --git a/frontend/src/app/features/calendar/op-calendar.service.ts b/frontend/src/app/features/calendar/op-calendar.service.ts
index e89acd098ca..f40f53b671b 100644
--- a/frontend/src/app/features/calendar/op-calendar.service.ts
+++ b/frontend/src/app/features/calendar/op-calendar.service.ts
@@ -35,14 +35,11 @@ export class OpCalendarService extends UntilDestroyedMixin {
}
applyNonWorkingDay({ date }:{ date?:Date }, nonWorkingDays:IDay[]):string[] {
- if (date) {
- // we need to find the UTC date for each date while highlighting non-wrking days on full-calendar
- const utcDate = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
- const formatted = moment(utcDate).format('YYYY-MM-DD');
- if (this.weekdayService.isNonWorkingDay(utcDate) || nonWorkingDays.find((el) => el.date === formatted)) {
- return ['fc-non-working-day'];
- }
+ const formatted = moment(date).format('YYYY-MM-DD');
+ if (date && (this.weekdayService.isNonWorkingDay(date) || nonWorkingDays.find((el) => el.date === formatted))) {
+ return ['fc-non-working-day'];
}
+
return [];
}
}