TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dev Teywa
NA
250
40.6k
filter ,date pipe using angular2
Feb 6 2018 12:29 PM
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;
}
}
}
Reply
Answers (
11
)
show and hide element for each clicked button in angular2+
how to avoid display redundancy of result in typescript