Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Add date column to benchmark component (#2466)

Aldrin5db984ffef13
diff --git a/libs/ui/src/lib/benchmark/benchmark.component.html b/libs/ui/src/lib/benchmark/benchmark.component.html
index e395553ec4..33cf72389a 100644
--- a/libs/ui/src/lib/benchmark/benchmark.component.html
+++ b/libs/ui/src/lib/benchmark/benchmark.component.html
@@ -6,14 +6,33 @@
</td>
</ng-container>
+ <ng-container matColumnDef="date">
+ <th
+ *matHeaderCellDef
+ class="d-none d-lg-table-cell px-2 text-right"
+ mat-header-cell
+ >
+ <ng-container i18n>Last All Time High</ng-container>
+ </th>
+ <td *matCellDef="let element" class="d-none d-lg-table-cell px-2" mat-cell>
+ <div class="d-flex justify-content-end">
+ <gf-value
+ [isDate]="true"
+ [locale]="locale"
+ [value]="element?.performances?.allTimeHigh?.date"
+ ></gf-value>
+ </div>
+ </td>
+ </ng-container>
+
<ng-container matColumnDef="change">
- <th *matHeaderCellDef class="text-right" mat-header-cell>
+ <th *matHeaderCellDef class="px-2 text-right" mat-header-cell>
<span class="d-none d-sm-block text-nowrap" i18n
>Change from All Time High</span
>
<span class="d-block d-sm-none text-nowrap" i18n>from ATH</span>
</th>
- <td *matCellDef="let element" class="text-right" mat-cell>
+ <td *matCellDef="let element" class="px-2 text-right" mat-cell>
<gf-value
class="d-inline-block justify-content-end"
size="medium"
@@ -25,9 +44,7 @@
'text-success':
element?.performances?.allTimeHigh?.performancePercent > 0
}"
- [value]="
- element?.performances?.allTimeHigh?.performancePercent ?? undefined
- "
+ [value]="element?.performances?.allTimeHigh?.performancePercent"
></gf-value>
</td>
</ng-container>
diff --git a/libs/ui/src/lib/benchmark/benchmark.component.ts b/libs/ui/src/lib/benchmark/benchmark.component.ts
index a5c117c244..b9f1dd25b2 100644
--- a/libs/ui/src/lib/benchmark/benchmark.component.ts
+++ b/libs/ui/src/lib/benchmark/benchmark.component.ts
@@ -18,7 +18,7 @@ export class BenchmarkComponent implements OnChanges {
@Input() benchmarks: Benchmark[];
@Input() locale: string;
- public displayedColumns = ['name', 'change', 'marketCondition'];
+ public displayedColumns = ['name', 'date', 'change', 'marketCondition'];
public resolveMarketCondition = resolveMarketCondition;
public constructor() {}