From ca794df2a8fec4cb45a1e835f04b5d8446d8b597 Mon Sep 17 00:00:00 2001 From: Hans-Christian Payer Date: Sun, 12 Jul 2026 12:52:15 +0200 Subject: [PATCH] =?UTF-8?q?pensionsz=C3=A4hler=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.html | 4 ++++ src/app/app.component.ts | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/app/app.component.html b/src/app/app.component.html index b1b424b..5ac1e1f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -16,6 +16,10 @@ Pi-hole + + + Noch {{ tageBisPension }} Tage bis zur Pension + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 74650f8..a18b1d4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -7,4 +7,11 @@ import { Component } from '@angular/core'; }) export class AppComponent { title = 'ang-university-httpclient'; + get tageBisPension(): number { + const pension = new Date(2027, 0, 1); // 1.1.2027 + const heute = new Date(); + heute.setHours(0, 0, 0, 0); + const diff = pension.getTime() - heute.getTime(); + return Math.ceil(diff / (1000 * 60 * 60 * 24)); + } }