So I'm just using a method to filter it's working like a charm but I'm losing my original Array when there is no date between I provided (as expected). What can I do to not lose my Array.
I want this because when a person gives a new date, filter it without a reload. But I cannot do it with empty Array..
Here is my function;
filterByDate(d) {
this.orders = this.orders.filter(
(element) =>
element.order.orderdate >= d[0] &&
element.order.orderdate <= d[1]
);
},
d[0] is fromDate, d[1] is toDate. Thanks.
filterByDate(d). I mean like this,this.orders = this.originalOrders.filter(). Vuex hasmapStateto make this easier.