попробуйте эту трубу
import {
Pipe,
PipeTransform
} from '@angular/core';
@Pipe({
name: 'dateConvert'
})
export class DateConvertPipe implements PipeTransform {
transform(d: string): string {
const date = new Date(d);
date.toLocaleString('fr-FR', {
hour: 'numeric',
hour12: true
});
const monthNames = [
'Janv', 'Févr', 'Mars',
'Avr', 'Mai', 'Juin', 'Juill',
'août', 'Sep', 'Oct',
'Nov', 'Dec'
];
const day = date.getUTCDay();
const monthIndex = date.getMonth();
const year = date.getFullYear();
const hours = date.getHours();
const min = date.getMinutes();
const sec = date.getSeconds();
return day + ' ' + monthNames[monthIndex] + ' ' + year + ' ' + hours + ':' + min + ':' + sec;
}
}
<span>{{ s.subscriptionDate | dateConvert}}</span>