I'm new in stackoverflow: Here is my issue, i would like to count how many tickets by month a user has and push it in my array, i did that:
for(j=0; j< data.data.tickets.length ;j++){
var requesterid = data.data.tickets[j].requester_id;
var created_at = data.data.tickets[j].created_at;
var today = new Date().toISOString().slice(0, 7);
if(created_at.includes(today)&& requesterid == cleartab[requesterid]['id']){total ++}
var arrayRef2 = cleartab[requesterid]['monthly'] || [];
cleartab[requesterid]['monthly'] = arrayRef2.concat([{"janvier":total}], [{"fevier":"fef"}]);
}
The problem is that it gave me wrong result.
Here is my array:
If my question is not clear, i can re-explain or tell me if you need something more to answer it
I hope you can help me
My issue:
Some people should not have ticket the result is not the good one. I would like to be sure that it increment only one people when 1 ticket has been sent in the current month. For now, when someone send a ticket in the current month, every user got +1 ticket in the current month. But what i want is that: it increment only for one user, the user who sent the ticket. Is that clear ?
totalwhich is shared by everyone? Have you tried making that a local variable?