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

set the include non-working days in calender while selecting a date to create a WP

bsatarnejad1c5d2e9aae27
diff --git a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
index 8e90a8de9f4..89338dca444 100644
--- a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
@@ -314,9 +314,15 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
}
private handleDateClicked(info:DateSelectArg) {
+ const startDay = new Date(info.start).getDate();
+ const endDay = new Date(info.end).getDate();
+ const duration = endDay - startDay;
+ const nonWorkingDays = duration !== 1 ? false : this.weekdayService.isNonWorkingDay(info.start);
+
const defaults = {
startDate: info.startStr,
dueDate: this.workPackagesCalendar.getEndDateFromTimestamp(info.endStr),
+ ignoreNonWorkingDays: nonWorkingDays,
};
void this.$state.go(