Hi,
can some one please help me out to filter display data based on date.
I am able to filter it by string but no success while it’s number. below is my code:
transform(items:any, originCity:any, destinationCity:any, arrLocSearch:any, arrvDate:any):any {
// transform(items: Array, cmpSearch: string, arrLocSearch: string, deptLocSearch: string, arrvDate: number){
if (items && items.length){
return items.filter(item =>{
if (originCity && item.arrvLocation.toLowerCase().indexOf(originCity.toLowerCase()) === -1){
return false;
}
if (destinationCity && item.deptLocation.toLowerCase().indexOf(destinationCity.toLowerCase()) === -1){
return false;
}
if (arrLocSearch && item.arrvLocation.toLowerCase().indexOf(arrLocSearch.toLowerCase()) === -1){
return false;
}
if (arrvDate && item.arriveDate.indexOf(arrvDate) === -1 ){
return false;
}
return true;
})
what need to put here
if (arrvDate && item.arriveDate.indexOf(arrvDate) === -1 ){
return false;
}