+ @if (bundProject.description) { + +
+ description +

Beschreibung

+
+

{{ bundProject.description }}

+
+ } @if (getAssociatedPersons().length > 0) { @@ -351,11 +357,11 @@ } @if (getDuration()) { diff --git a/webapp/src/app/modules/projects/bund-details/bund-details.component.ts b/webapp/src/app/modules/projects/bund-details/bund-details.component.ts index 5ad9007b..3a5c3f6c 100644 --- a/webapp/src/app/modules/projects/bund-details/bund-details.component.ts +++ b/webapp/src/app/modules/projects/bund-details/bund-details.component.ts @@ -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(); }