Фильтруйте детали по дате начала и дате окончания в angular2+
hi, I want to filter some details by start date and end date PS: i have array in component contains details and start date and end date i created this pipe but it doesn't work how to do please and thanks in advance
Что я уже пробовал:
import { Pipe, PipeTransform } from '@angular/core'; import { DatePipe } from '@angular/common'; @Pipe({ name: 'dateFormatPipe', }) export class dateFormatPipe implements PipeTransform { transform(projetList:any,value1: string,value2: string) { if (projetList && projetList.length) { var datePipe = new DatePipe("en-US"); value1= datePipe.transform(value1, 'dd/MM/yyyy'); value2= datePipe.transform(value2, 'dd/MM/yyyy'); projetList.forEach(proj => { if (value1 >= value2) { return proj.title; } }); } else { return projetList; } } }