BUND projects component adjustments

This commit is contained in:
2026-06-23 00:09:27 +02:00
parent 52a259a927
commit 89fc34996e
2 changed files with 32 additions and 30 deletions
@@ -46,14 +46,21 @@
<mat-icon>calendar_today</mat-icon>
<div class="metric-content">
<strong>{{ getStartDate() || 'N/A' }}</strong>
<span>Startdatum</span>
<span>Förderbeginn</span>
</div>
</div>
<div class="metric-item">
<mat-icon>event_busy</mat-icon>
<div class="metric-content">
<strong>{{ getFundingStatus(getEndDate()) }}</strong>
<span>Enddatum</span>
<span>Förderende</span>
</div>
</div>
<div class="metric-item">
<mat-icon>access_time</mat-icon>
<div class="metric-content">
<strong>{{ getStatusDisplay(bundProject.funding_end_date) }}</strong>
<span>Status</span>
</div>
</div>
@if (bundProject.funding_amount) {
@@ -77,18 +84,17 @@
</div>
</div>
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
</mat-card>
}
<div class="content-grid">
<main class="main-content">
@if (bundProject.description) {
<mat-card appearance="outlined" class="card description-card">
<div class="section-header">
<mat-icon>description</mat-icon>
<h2>Beschreibung</h2>
</div>
<p class="description-text">{{ bundProject.description }}</p>
</mat-card>
}
<!-- Beteiligte Personen -->
@if (getAssociatedPersons().length > 0) {
<mat-card appearance="outlined" class="card">
@@ -351,11 +357,11 @@
}
<!-- <div class="detail-row">
<dt>Startdatum</dt>
<dt>Förderbeginn</dt>
<dd>{{ getStartDate() || 'N/A' }}</dd>
</div>
<div class="detail-row">
<dt>Enddatum</dt>
<dt>Förderende</dt>
<dd>{{ getFundingStatus(getEndDate()) }}</dd>
</div> -->
@if (getDuration()) {
@@ -5,7 +5,7 @@ import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { BundProjectDetails } from '../../../api/model/bundProjectDetails';
import { Router } from '@angular/router';
import { formatGermanDate } from '../../../shared/utils/formatters';
@Component({
selector: 'app-bund-details',
standalone: true,
@@ -41,8 +41,8 @@ export class BundDetailsComponent implements OnInit {
const year = parseInt(fundingEndDate, 10);
if (isNaN(year)) return fundingEndDate;
return year >= new Date().getFullYear()
? `${fundingEndDate} (laufend)`
: `${fundingEndDate} (abgeschlossen)`;
? `${fundingEndDate}`
: `${fundingEndDate}`;
}
formatCurrency(amount: number | null | undefined): string {
@@ -104,15 +104,6 @@ export class BundDetailsComponent implements OnInit {
// }
// });
// }
private formatGermanDate(dateString: string): string {
if (!dateString) return '';
return new Intl.DateTimeFormat('de-DE', {
day: 'numeric',
month: 'long',
year: 'numeric',
}).format(new Date(dateString));
}
/**
* All associated persons as a simple list.
*/
@@ -120,11 +111,11 @@ export class BundDetailsComponent implements OnInit {
return this.bundProject?.associated_persons || [];
}
getStartDate(): string {
return this.formatGermanDate(this.bundProject?.funding_start_date ?? '');
return formatGermanDate(this.bundProject?.funding_start_date ?? '');
}
getEndDate(): string {
return this.formatGermanDate(this.bundProject?.funding_end_date ?? '');
return formatGermanDate(this.bundProject?.funding_end_date ?? '');
}
getDuration(): string {
@@ -133,7 +124,7 @@ export class BundDetailsComponent implements OnInit {
if (!start || !end) return '';
return `von ${this.formatGermanDate(start)} bis ${this.formatGermanDate(end)}`;
return `von ${formatGermanDate(start)} bis ${formatGermanDate(end)}`;
}
/**
* All institutions as a simple list.
@@ -156,7 +147,12 @@ export class BundDetailsComponent implements OnInit {
if (!this.bundProject?.funding_amount) return 'N/A';
return this.formatCurrency(this.bundProject.funding_amount);
}
getStatusDisplay(fundingEndDate: string | null | undefined): string {
if (!fundingEndDate) return 'N/A';
if (fundingEndDate === '2999') return 'Laufend';
const year = parseInt(fundingEndDate, 10);
return year >= new Date().getFullYear() ? `Laufend` : `Abgeschlossen`;
}
goBack(): void {
window.history.back();
}