Hello Everyone! I am looking to understand how to proceed with JavaScript Block interact with Condition Block, this is my JS script. Basically I am converting a timestamp date to DD/MM/YYYY and checking after convertion if the date is 7 days ahead or no.
var setVariable{{diferencaDias}};
function verificarPrazo({{DATAINICIOASSINATURA}}) { const data = new Date(timestamp);
const dia = String(data.getDate()).padStart(2, '0'); const mes = String(data.getMonth() + 1).padStart(2, '0'); // Janeiro é 0! const ano = data.getFullYear(); const dataFormatada = dia + '/' + mes + '/' + ano;
I am not able to check if var diferencaDias is greather or less than 7 days. I am pretty sure I am doing something wrong, but not sure if this in the code or no.
The flow starts after a user want to cancel a subscription of a product, so in this print below (not the entire flow), I am just checking if a subscription is valid or no, then I will check if the subscription is 7 days ahead of start or no.