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

add a method to day service to fetch NWds of two dates in different years

bsatarnejadfa404f140581
diff --git a/frontend/src/app/core/state/days/day.service.ts b/frontend/src/app/core/state/days/day.service.ts
index c2c7968974e..a4150db72ba 100644
--- a/frontend/src/app/core/state/days/day.service.ts
+++ b/frontend/src/app/core/state/days/day.service.ts
@@ -57,6 +57,17 @@ export class DayResourceService extends ResourceCollectionService<IDay> {
return this.require({ filters });
}
+ requireNonWorkingYears$(start:Date|string, end:Date|string):Observable<IDay[]> {
+ const from = moment(start).startOf('year').format('YYYY-MM-DD');
+ const to = moment(end).endOf('year').format('YYYY-MM-DD');
+
+ const filters:ApiV3ListFilter[] = [
+ ['date', '<>d', [from, to]],
+ ];
+
+ return this.require({ filters });
+ }
+
fetchCollection(params:ApiV3ListParameters):Observable<IHALCollection<IDay>> {
const collectionURL = collectionKey(params);