Filter by date angular 2 or 4

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;
            }

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums