I have the following code of a function, I need to get the day of the week from a day that is sent to the function, so I have it:
diaSemana : function(d){
var fecha = new Date();
var dias = ["L", "M", "X", "J", "V", "S", "D"];
var mes = fecha.getMonth()+1; //obteniendo mes
var dia = d;
var ano = fecha.getFullYear(); //obteniendo año
if(dia<10)
dia='0'+dia; //agrega cero si el menor de 10
if(mes<10)
mes='0'+mes; //agrega cero si el menor de 10
var fec = (dia+"/"+mes+"/"+ano);
return dias[fec.valueAsDate.getDay()];
}
I want to show next to the day number, the name of the day of the week, for that I send it to the function the day.
I'm a newbie in JavaScript.