Good I have this in my js, the problem is that in my database every column is a month and I keep the city for example. city: in, column1 (January): 12 etc ..
What I want first is to catch the current month to print the number you have, what occurred to me was to make a data dictionary to check what month we are and so when I browse my array nothing concatenarle, but at the time of printing mes1 marks me indefinitely what am I doing wrong, maybe the dictionary?
var f=new Date();
var mes = f.getMonth()+1;
var mesess = new Array();
mesess[1] ="en";
mesess[2] ="fe";
mesess[3] ="ma";
mesess[4] ="ab";
mesess[5] ="may";
mesess[6] ="ju";
mesess[7] ="jul";
mesess[8] ="ag";
mesess[9] ="se";
mesess[10] ="oc";
mesess[11] ="no";
mesess[12] ="di";
console.log(mesess);
mes2=mesess[mes];
for(var i=0; i<json.Data.meta.length;i++)
{
if(json.Data.meta[i].ciudad=='En')
{
mes1=json.Data.meta[i].mes2;
}
}
What I want to do is something like this
mes1=json.Data.meta[i].en;
depending on the number of months that is for example if in my var mes = f.getMonth()+1;
is 1 (It is the month of January) then I put mes1=json.Data.meta[i].en;
if the month is 2 (is the month of February) then put me mes1=json.Data.meta[i].fe;
I do not know if you explain