From db845bfee2f2c804bd122b748d653c9e3a185044 Mon Sep 17 00:00:00 2001 From: HarveyMac Date: Sat, 5 Nov 2022 16:46:12 +0800 Subject: [PATCH] =?UTF-8?q?DatePipe=EF=BC=8C=E8=A9=B3=E7=B4=B0=E8=AB=8B?= =?UTF-8?q?=E6=9F=A5=E9=96=B1=E7=B6=B2=E8=B7=AF=E7=94=A8=E6=B3=95?= 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 | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index df235d6..8aa119e 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,3 +1 @@ -
金額:{{ 25000 | currency }}
-
CAD 貨幣碼:{{ 25000 | currency: "CAD" }}
-
貨幣指示格式:{{ 25000 | currency: "EUR":"symbol" }}
+UTC時間:{{ now | date: "long":"+0800" }} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1e0d456..412a3bb 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,10 @@ -import { Component, VERSION } from '@angular/core'; +import { Component } from '@angular/core'; @Component({ selector: 'my-app', templateUrl: './app.component.html', - styleUrls: [ './app.component.css' ] + styleUrls: ['./app.component.css'], }) -export class AppComponent { - pi = 3.1415926; +export class AppComponent { + now = new Date(); }