Skip to main content

I’m trying to integrate a new app in the Platform UI but its GET request doesn’t come in reverse chronological order and has pagination. In order to get the last results I thought in filtering by date.

Can I insert a function to get today’s date and the last day in the place of the dates below?

params: {
'apikey': bundle.authData.apikey,
'filters': 'dataEmissaot06/05/2020 TO 07/05/2020]'
}

 

@Marcel Khouri  Insert this at the beginning of your code and call it to get today’s date in DD/MM/YYYY format.

function getTodayDate() {
const d = new Date();
const day = String(d.getDate()).padStart(2, "0");
const month = String(d.getMonth() + 1).padStart(2, "0");
const year = d.getFullYear();
return `${day}/${month}/${year}`;
}

 


Ok thanks! It worked.