I know that there is .filter()
that in it I can filter an array to return it just the way I want it, and using a lot to search, when we pass what we want to search in that array.
But I'm having trouble filtering an array of dates like this:
["08:00" "09:00" "10:10" "10:30" "10:50" "11:30" "11:50" "12:00"];
I need to filter it by past date I have start date and end date, eg step for it "09:00"
and "11:30"
it should return to me:
["10:10" "10:30" "10:50"]
Trying to do this I did so in my typescript
:
1. this.schedules = this.navigation.lineSelected.schedules;
2. this.schedules.filter(item => {
3. item > this.hourNow && item < this.hourFinish
4. });
On line 1 I get all the times I have, so on line 2.4 I filter this array, but it returns all of it to me.
How can I do this?