Skip to content

Commit

Permalink
Merge branch 'release/15.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
openprojectci committed Jan 7, 2025
2 parents 14f8532 + cfe8d8b commit 0405c04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
}
}

async requireNonWorkingDays(date:Date|string) {
this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYear$(date));
async requireNonWorkingDays(start:Date|string, end:Date|string) {
this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYears$(start, end));
}

isNonWorkingDay(date:Date|string):boolean {
Expand All @@ -160,8 +160,7 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
fetchInfo:{ start:Date, end:Date, timeZone:string },
projectIdentifier:string|undefined,
):Promise<unknown> {
await this.requireNonWorkingDays(fetchInfo.start);
await this.requireNonWorkingDays(fetchInfo.end);
await this.requireNonWorkingDays(fetchInfo.start, fetchInfo.end);

if (this.areFiltersEmpty && this.querySpace.query.value) {
// nothing to do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ export class TimeEntryCalendarComponent {
void this.weekdayService.loadWeekdays()
.toPromise()
.then(async () => {
const date = moment(new Date()).toString();
await this.requireNonWorkingDays(date);
const startOfWeek = moment().startOf('week').format('YYYY-MM-DD');
const endOfWeek = moment().endOf('week').format('YYYY-MM-DD');
await this.requireNonWorkingDays(startOfWeek, endOfWeek);
this.additionalOptions.hiddenDays = this.setHiddenDays(displayedDayss);
this.calendarOptions$.next(
this.additionalOptions,
Expand Down Expand Up @@ -211,8 +212,8 @@ export class TimeEntryCalendarComponent {
readonly dayService:DayResourceService,
) {}

async requireNonWorkingDays(date:Date|string) {
this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYear$(date));
async requireNonWorkingDays(start:Date|string, end:Date|string) {
this.nonWorkingDays = await firstValueFrom(this.dayService.requireNonWorkingYears$(start, end));
}

public calendarEventsFunction(
Expand Down Expand Up @@ -255,8 +256,7 @@ export class TimeEntryCalendarComponent {

private async buildEntries(entries:TimeEntryResource[], fetchInfo:{ start:Date, end:Date }):Promise<EventInput[]> {
this.setRatio(entries);
await this.requireNonWorkingDays(fetchInfo.start);
await this.requireNonWorkingDays(fetchInfo.end);
await this.requireNonWorkingDays(fetchInfo.start, fetchInfo.end);
return this.buildTimeEntryEntries(entries)
.concat(this.buildAuxEntries(entries, fetchInfo));
}
Expand Down

0 comments on commit 0405c04

Please sign in to comment.