Hi @Erika Jaramillo ,
I'll try to look into the JS, but could you check and see whether the date automation that you are performing with JS can be achieved through A360 Actions?
There is a DateTime Package which can help you with that, so try using that before using scripts.
When we develop automations as RPA developers, the next person tasked with handling your Automation may or may not know how to work with JS so its better to use Inbuilt Actions wherever we can.
Kind Regards,
Ashwin A.K
the parameter passed to JS function is not Date object but a string
it should be converted to Date object then it could have method getMonth()
function fDiaLaborable (dFecha){
var dateObj = new Date(dFecha); // add this line.
var dia2 = 1;
var mes = dateObj.getMonth();
var anio = dateObj.getFullYear();
var fecha = new Date (anio, mes, dia2)
var dia = fecha.getDay();
if(dia === 6 ){
dia2 = dia2+2;
}
mes = mes+1;
var resultado = dia2+"/"+mes+"/"+anio;
return resultado;
}
and the date string format should in specific format.
Thanks! That solves it all, I only have one additional question I'm use this format for the date 31/08/2022, and I send this parameter, the script output send this 1/Nan/Nan, how could I solve?