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

pull/11934/head
bsatarnejad 2 years ago
parent eea8e64f43
commit fa404f1405
  1. 11
      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);

Loading…
Cancel
Save