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 .
(我正在寻找按月和年过滤的数组,该数组位于日期为dd / mm / yyy的行的位置3上。)
array generated from a google sheets:
(从Google表格生成的数组:)
[[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]]
([[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]]
([[2,131,ALEISIO,13 / 11 / 2019 ,ggg,33],[3,134,DIOGO,25 / 11 / 2019 ,gggg,2]])
ask by user2916405 translate from so