Best answer

Platform UI date filter today

  • 8 May 2020
  • 2 replies
  • 1406 views

Userlevel 1

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': 'dataEmissao[06/05/2020 TO 07/05/2020]'
}

 

icon

Best answer by ikbelkirasan 8 May 2020, 00:45

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +11

@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}`;
}

 

Userlevel 1

Ok thanks! It worked.