0
Well I know there’s a .filter()
that in it I can filter an array to return it just the way I want, and using a lot for research, when we spend 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 last date I have start date and end date, for example step to it "09:00"
and "11:30"
he shall return to me:
["10:10" "10:30" "10:50"]
Trying to do this I did so in mine 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 receive all the times I have, then on line 2,4 I filter this array, but it returns me it all.
How can I do this ?
you don’t need to use the
return
before the:item > this.hourNow...
?– JuniorNunes