Help

Re: Configure an input date

583 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I often have to look up old conversion rates and match them to items that was paid at a specific dates.

I’ve been playing around with the scripting block and been trying to figure out if I can get a drop-down calendar in my block, however it seems not possible atm.

For now I’m thinking I want to be able to pass an input string, have that to lookup historic currency rates.
However I’m alittle stuck on getting to grips with how to format dates.

I would have thought the below would send me the input date, however I get nothing atm.

let table = base.getTable('Match currency to date')
let date = await input.textAsync('Choose a date you want to look up')
let checkDate = new Date(date);

console.log(checkDate.getDate)
2 Replies 2
Philipp_Koch
4 - Data Explorer
4 - Data Explorer

Hi Kim,

The input of a date fields gets validated as soon as the output is needed, so I put the input of the String into a Date field and use that for a most simple Are2Sure question box as follows:

let billTillString = await input.textAsync(‘Bill Orders till which date? (format YYYY-MM-DD)’);

let billTillDate = new Date(billTillString);

let continueButton = await input.buttonsAsync('Continue with Invoice creation till ’ + billTillDate.toDateString(), [‘Continue’, ‘Abort’]);

if (continueButton == ‘Continue’) {

Continue abort button is a good idea - thank you