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 correct date while specific filters are selected like yesterday

bsatarnejad86dbf0c69084
diff --git a/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts b/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
index 2b76ae43453..228bf1b6a59 100644
--- a/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-baseline/baseline/baseline.component.ts
@@ -160,9 +160,7 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements OnInit {
if (this.wpTableBaseline.isActive()) {
this.filterChange(baselineFilterFromValue(this.wpTableBaseline.current));
-
this.wpTableBaseline.current.forEach((value, i) => {
-
if (value.includes('@')) {
const [, timeWithZone] = value.split(/[@]/);
const time = timeWithZone.split(/[+-]/)[0];
@@ -205,19 +203,20 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements OnInit {
}
public filterChange(value:string|null):void {
+ this.resetSelection();
this.selectedFilter = value;
switch (value) {
case 'oneDayAgo':
- this.mappedSelectedDate = this.timezoneService.formattedDate(this.wpTableBaseline.yesterdayDate());
+ this.updateDateValues(this.wpTableBaseline.yesterdayDate());
break;
case 'lastWorkingDay':
- this.mappedSelectedDate = this.timezoneService.formattedDate(this.wpTableBaseline.lastWorkingDate());
+ this.updateDateValues(this.wpTableBaseline.lastWorkingDate());
break;
case 'oneWeekAgo':
- this.mappedSelectedDate = this.timezoneService.formattedDate(this.wpTableBaseline.lastweekDate());
+ this.updateDateValues(this.wpTableBaseline.lastweekDate());
break;
case 'oneMonthAgo':
- this.mappedSelectedDate = this.timezoneService.formattedDate(this.wpTableBaseline.lastMonthDate());
+ this.updateDateValues(this.wpTableBaseline.lastMonthDate());
break;
default:
this.mappedSelectedDate = null;
@@ -225,6 +224,11 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements OnInit {
}
}
+ private updateDateValues(date:string) {
+ this.mappedSelectedDate = this.timezoneService.formattedDate(date);
+ this.dateChange([date]);
+ }
+
private buildBaselineFilter():string[] {
switch (this.selectedFilter) {
case 'oneDayAgo':