In a document I have a date field which is referenced such has
var date_of_notarial_act_id = 'fld-76fd68bf708e4bde87998a0cba32ffcd';
var date_of_notarial_act = record.getFieldValue('fld-76fd68bf708e4bde87998a0cba32ffcd');
but I would like to add 5 days to it and then that new date written to another form. Doing something such as:
var write_up_notarial_register_date = date_of_notarial_act + 5;
Does not work. Is what I would like to do possible with JavaScript in Tap Forms?
Any help would be gratefully appreciated.
The easiest I think would be to use a calculation field instead of a script field: DATEADD([date_of_notarial_act];0;0;0;5;0;0;0)
.
Or in Javascript
// Create date object
let write_up_notarial_register_date = new Date(date_of_notarial_act);
// Add five days to current date
write_up_notarial_register_date.setDate(write_up_notarial_register_date.getDate() + 5);
Daniel,
Thank you for the information.
It has to be in JavaScript as is needed for use within a longer script.