Como calcular datas

Estou fazendo um filtro:

let data = new Date ();
let dia = String ( data . getDate ()-2). padStart ( 2 , ‘0’ );
let mes = String ( data . getMonth () + 1 ). padStart ( 2 , ‘0’ );
let ano = data . getFullYear ();
let dataAtual = dia + ‘/’ + mes + ‘/’ + ano ;
$w ( ‘#text291’ ). text = dataAtual
wixData . query ( “TesteFormulario” )
. gt ( “_createdDate” , dataAtual )
. eq ( “status” , “Aberto” )
. eq ( “clique” , 0 )
. count ()
. then ( function ( resultado ) {
let totalSolicitacoes = resultado
$w ( ‘#text237’ ). text = String ( totalSolicitacoes )


. gt ( “_createdDate” , dataAtual ) não funciona
preciso saber as solicitações com pelo menos 2 dias abertas com zero visualizações, só não funciona a data.

Podem me ajudar? Será que o formato de datas estão diferentes e isso esteja gerando a falha no calculo?

Please remember this is an English Only board. Regarding your question: you are comparing _createdDate (a JS type Date) to a string. Will " não funciona". Next time, please try Google Translate, it’s pretty good.

The column _createdDate on collection is DateTime datatype so you don’t need o format it using string.
Try:
. gt ( “_createdDate” , data ) <===== use the data instead dataAtual

A coluna _createdDate na coleção é do tipo DateTime então você não precisa format a data usando string. Tente: . gt ( "_createdDate" , data ) <===== use data ao invés de dataAtual

@mvveiga Thank you very much, I will try it that way.