Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/05/2015, 03:15
rubengonzalez
 
Fecha de Ingreso: mayo-2008
Mensajes: 11
Antigüedad: 16 años
Puntos: 0
rellenar array con importe de cada mes

Hola, tengo un array de objetos con todos estos datos:

[{"Fecha":{"Month":1,"Year":2015},"Importe":1},{"Fe cha":{"Month":2,"Year":2015},"Importe":1},{"Fecha" :{"Month":3,"Year":2015},"Importe":1},{"Fecha":{"M onth":4,"Year":2015},"Importe":1},{"Fecha":{"Month ":5,"Year":2015},"Importe":1},{"Fecha":{"Month":5, "Year":2014},"Importe":1},{"Fecha":{"Month":6,"Yea r":2014},"Importe":1},{"Fecha":{"Month":7,"Year":2 014},"Importe":1},{"Fecha":{"Month":8,"Year":2014} ,"Importe":1},{"Fecha":{"Month":9,"Year":2014},"Im porte":1},{"Fecha":{"Month":10,"Year":2014},"Impor te":1},{"Fecha":{"Month":11,"Year":2014},"Importe" :1}]

Yo quiero pasar todos esos datos a otro array, los meses de cada año que están en el array el importe lo guardo y si el mes del año no esta en el array asignarle 0.

Quedaría de la siguiente forma:
datos =[ ["2015, 1,1,1,1,1,0,0,0,0,0,0,0], ["2014", 0, 0,0,0,0,1,1,1,1,1,1,0]

Con que me digáis la forma de hacerlo sería suficiente.

Un saludo