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

FIX #12091 TIME 0:15 fix date pipe (nb days)

parent dd142730
No related branches found
No related tags found
No related merge requests found
...@@ -80,17 +80,17 @@ ...@@ -80,17 +80,17 @@
<ng-container *ngIf="row.closing_date != lang.undefined"> <ng-container *ngIf="row.closing_date != lang.undefined">
<i class="fa fa-lock" title="{{lang.closingDate}}"></i>&nbsp;<span <i class="fa fa-lock" title="{{lang.closingDate}}"></i>&nbsp;<span
[innerHTML]="row.closing_date | timeAgo" [innerHTML]="row.closing_date | timeAgo"
title='{{row.closing_date | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}'></span> title='{{row.closing_date | fullDate}}'></span>
</ng-container> </ng-container>
<ng-container *ngIf="row.closing_date == lang.undefined"> <ng-container *ngIf="row.closing_date == lang.undefined">
<i class="fa fa-calendar" <i class="fa fa-calendar"
title="{{lang.creationDate}}"></i>&nbsp;<span title="{{lang.creationDate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue.creationDate | timeAgo" [innerHTML]="data.displayValue.creationDate | timeAgo"
title='{{data.displayValue.creationDate | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}'></span> title='{{data.displayValue.creationDate | fullDate}}'></span>
- <i class="fa fa-stopwatch" - <i class="fa fa-stopwatch"
title="{{lang.processLimitDate}}"></i>&nbsp;<span title="{{lang.processLimitDate}}"></i>&nbsp;<span
[innerHTML]="data.displayValue.processLimitDate | timeLimit" [innerHTML]="data.displayValue.processLimitDate | timeLimit"
title='{{data.displayValue.processLimitDate | date : lang.onRange + " dd/MM/y " + lang.atRange +" HH:mm"}}'></span> title='{{data.displayValue.processLimitDate | fullDate}}'></span>
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-container *ngIf="data.icon != ''"> <ng-container *ngIf="data.icon != ''">
......
...@@ -11,6 +11,6 @@ export class FullDatePipe implements PipeTransform { ...@@ -11,6 +11,6 @@ export class FullDatePipe implements PipeTransform {
transform(value: string) { transform(value: string) {
const date = new Date(value); const date = new Date(value);
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' }; const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };
return this.lang.onRange + ' ' + date.toLocaleDateString('fr-FR', options); return this.lang.onRange[0].toUpperCase() + this.lang.onRange.substr(1).toLowerCase() + ' ' + date.toLocaleDateString('fr-FR', options);
} }
} }
\ No newline at end of file
...@@ -63,14 +63,11 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy { ...@@ -63,14 +63,11 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy {
return this.getFormatedDate(this.lang.at.toLowerCase(), hourNumber + ':' + minuteNumber, args); return this.getFormatedDate(this.lang.at.toLowerCase(), hourNumber + ':' + minuteNumber, args);
//return hours + ' heures'; //return hours + ' heures';
} else if (hours <= 24) { } else if (hours <= 24) {
return this.getFormatedDate(this.lang.dateTo.toLowerCase(), dayNumber + ' ' + month[d.getMonth()], args); return this.getFormatedDate(this.lang.dateAgo.toLowerCase(), days + ' ' + this.lang.dayS, args);
//return 'un jour'; //return 'un jour';
} else if (days <= 25) { } else if (days <= 5) {
return this.getFormatedDate(this.lang.dateTo.toLowerCase(), d.getDate() + ' ' + month[d.getMonth()], args); return this.getFormatedDate(this.lang.dateAgo.toLowerCase(), days + ' ' + this.lang.dayS, args);
//return days + ' jours'; //return days + ' jours';
} else if (days <= 45) {
return this.getFormatedDate(this.lang.dateTo.toLowerCase(), d.getDate() + ' ' + month[d.getMonth()], args);
//return 'un mois';
} else if (days <= 345) { } else if (days <= 345) {
return this.getFormatedDate(this.lang.dateTo.toLowerCase(), d.getDate() + ' ' + month[d.getMonth()], args); return this.getFormatedDate(this.lang.dateTo.toLowerCase(), d.getDate() + ' ' + month[d.getMonth()], args);
//return months + ' mois'; //return months + ' mois';
......
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