Skip to content
Snippets Groups Projects
Commit abfeb3cc authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #12074 TIME 0:10 add fulldate pipe

parent 894cec72
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ import { CookieService } from 'ngx-cookie-service';
import { TimeAgoPipe } from '../plugins/timeAgo.pipe';
import { TimeLimitPipe } from '../plugins/timeLimit.pipe';
import { FilterListPipe } from '../plugins/filterList.pipe';
import { FullDatePipe } from '../plugins/fullDate.pipe';
/*FRONT IMPORTS*/
import { AppMaterialModule } from './app-material.module';
......@@ -99,6 +100,7 @@ export class MyHammerConfig extends HammerGestureConfig {
TimeAgoPipe,
TimeLimitPipe,
FilterListPipe,
FullDatePipe,
IndexingGroupModalComponent,
SmdFabSpeedDialComponent,
SmdFabSpeedDialTrigger,
......@@ -137,6 +139,7 @@ export class MyHammerConfig extends HammerGestureConfig {
TimeAgoPipe,
TimeLimitPipe,
FilterListPipe,
FullDatePipe,
PdfViewerModule,
NgStringPipesModule,
SmdFabSpeedDialComponent,
......
......@@ -11,7 +11,7 @@
<div mat-card-avatar><i color="primary" class="fa fa-user"></i></div>
<mat-card-title>{{note.firstname}} {{note.lastname}}</mat-card-title>
<mat-card-subtitle>{{note.entity_label}}</mat-card-subtitle>
<mat-card-subtitle title='{{note.creation_date | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}' class="dateNote">{{note.creation_date
<mat-card-subtitle title='{{note.creation_date | fullDate}}' class="dateNote">{{note.creation_date
| timeAgo}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
......
import { Pipe, PipeTransform } from "@angular/core";
import { LANG } from '../app/translate.component';
@Pipe({
name: 'fullDate',
pure: false
})
export class FullDatePipe implements PipeTransform {
lang: any = LANG;
constructor() { }
transform(value: string) {
const date = new Date(value);
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };
return this.lang.onRange + ' ' + date.toLocaleDateString('fr-FR', options);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment