Skip to main content
Best answer

Platform UI date filter today


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]'
 }

 

Best answer by ikbelkirasanBest answer by ikbelkirasan

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

 

View original
Did this topic help you find an answer to your question?
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

ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • May 7, 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.