I'm looking to filter an array by the month and year which found on position 3 of the row where the dates are dd/mm/yyy.
array generated from a google sheets:
[[1, 134, DIOGO, 03/12/2019, ggggg, 2], [2, 131, ALEISIO, 13/11/2019, ggg, 33], [3, 134, DIOGO, 25/11/2019, gggg, 2], [4, 134, DIOGO, 15/12/2019, tttttt, 2]]
var funcionarioId ="user1"
var month = "11"
var year = "2019";
var dataFiltered = data.filter(function(item){return item[1] === funcionarioId &&
item[3] === month &&
item[3] === year });
The expected results should be:
[[2, 131, ALEISIO, 13/11/2019, ggg, 33], [3, 134, DIOGO, 25/11/2019, gggg, 2]]
item[3]is a complete "date". How isitem[3] === month && item[3] === yearsupposed to work?