refactor: replace amDateFormat with new pipes

This commit is contained in:
Rainer Killinger
2021-06-16 16:59:24 +02:00
parent 4b932af1c0
commit 95b183b1bb
7 changed files with 37 additions and 16 deletions

View File

@@ -23,7 +23,7 @@
</ng-template>
<ion-card-header>
<ion-card-subtitle *ngIf="item.datePublished">{{
item.datePublished | amDateFormat: 'LLL'
item.datePublished | amCalendar | sentencecase
}}</ion-card-subtitle>
<ion-card-title>
<span *ngIf="item.sameAs; else titleNoUrl"

View File

@@ -43,6 +43,7 @@ const newsRoutes: Routes = [{path: 'news', component: NewsPageComponent}];
],
imports: [
IonicModule.forRoot(),
ThingTranslateModule.forChild(),
TranslateModule.forChild(),
RouterModule.forChild(newsRoutes),
CommonModule,

View File

@@ -0,0 +1,25 @@
<ion-card>
<span *ngIf="item.url; else imageNoUrl">
<a href="{{item.url}}">
<ion-thumbnail><ion-img src="{{item.image}}" (ionError)="$event.target.nextSibling.style.display='block'" alt=""></ion-img>
<ion-icon name="newspaper-outline"></ion-icon>
</ion-thumbnail>
</a>
</span>
<ng-template #imageNoUrl>
<ion-thumbnail>
<ion-img src="{{item.image}}" (ionError)="$event.target.nextSibling.style.display='block'" alt=""></ion-img>
<ion-icon name="newspaper-outline"></ion-icon>
</ion-thumbnail>
</ng-template>
<ion-card-header>
<ion-card-subtitle *ngIf="item.datePublished">{{item.datePublished | amCalendar | sentencecase}}</ion-card-subtitle>
<ion-card-title>
<span *ngIf="item.url; else titleNoUrl"><a href="{{item.url}}"><span class="text">{{item.name}}</span><span class="icon"><ion-icon name="open-outline"></ion-icon></span></a></span>
<ng-template #titleNoUrl>{{item.name}}</ng-template>
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{item.messageBody}}
</ion-card-content>
</ion-card>