mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-17 19:56:18 +00:00
refactor: replace amDateFormat with new pipes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<div *ngIf="origin.type === 'user'">
|
||||
<p>{{ origin.created | amDateFormat: 'll' }}</p>
|
||||
<p>{{origin.created | dateFormat}}</p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="origin.type === 'remote'">
|
||||
<p>{{ origin.indexed | amDateFormat: 'll' }}</p>
|
||||
<p>{{origin.indexed | dateFormat}}</p>
|
||||
</div>
|
||||
|
||||
@@ -7,13 +7,11 @@
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
<span>
|
||||
{{ item.repeatFrequency | amDuration }},
|
||||
{{ item.dates[0] | amDateFormat: 'dddd' }}
|
||||
<span
|
||||
>({{ item.dates[0] | amDateFormat: 'll' }} -
|
||||
{{
|
||||
item.dates[item.dates.length - 1] | amDateFormat: 'll'
|
||||
}})</span
|
||||
>
|
||||
{{ item.dates[0] | dateFormat: 'weekday:long' }}
|
||||
<span>
|
||||
({{ item.dates[0] | dateFormat }} -
|
||||
{{ item.dates[item.dates.length - 1] | dateFormat }})
|
||||
</span>
|
||||
</span>
|
||||
</p>
|
||||
<ion-note *ngIf="item.event.type === 'academic event'">{{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<div *ngIf="dishes | async as dishes; else loading">
|
||||
<ion-segment [(ngModel)]="selectedDay" mode="md">
|
||||
<ion-segment-button *ngFor="let day of dishes | keyvalue" [value]="day.key">
|
||||
<ion-label class="ion-hide-sm-down">{{day.key | amLocal | amDateFormat:'dddd, l'}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{day.key | amLocal | amDateFormat:'dd, l'}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-down">{{day.key | dateFormat:'weekday:long,month:numeric,day:numeric'}}</ion-label>
|
||||
<ion-label class="ion-hide-sm-up">{{day.key | dateFormat:'weekday:short,month:numeric,day:numeric' }}</ion-label>
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
<div [ngSwitch]="selectedDay">
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
<h2 class="name">{{ 'name' | thingTranslate: item }}</h2>
|
||||
<p>
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
<span
|
||||
>{{ item.startDate | amDateFormat: 'll' }} -
|
||||
{{ item.endDate | amDateFormat: 'll' }}</span
|
||||
>
|
||||
<span>{{item.startDate | dateFormat}} - {{item.endDate | dateFormat}}</span>
|
||||
</p>
|
||||
<ion-note>{{ 'type' | thingTranslate: item }}</ion-note>
|
||||
</div>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -43,6 +43,7 @@ const newsRoutes: Routes = [{path: 'news', component: NewsPageComponent}];
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(),
|
||||
ThingTranslateModule.forChild(),
|
||||
TranslateModule.forChild(),
|
||||
RouterModule.forChild(newsRoutes),
|
||||
CommonModule,
|
||||
|
||||
25
src/app/modules/news/page/news-item.html
Normal file
25
src/app/modules/news/page/news-item.html
Normal 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>
|
||||
Reference in New Issue
Block a user