Function Updated 19 Oct 2026
addDays(date, days)
Adding a number of days (positive or negative value) to a specified date.
Parameters
datedatetimerequiredDate object on which to add days to.
daysnumberrequiredHow many days to add to specified date.
Returns
A modified date, does not modify input date.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
var before = new Date(); // Create new date object
var after = docly.addDays(before, 5.2); // Add 5.2 days
}#
<b>Before:</b> #docly.format(before, "dd. MMM yyyy HH:mm")#<br>
<b>After:</b> #docly.format(after, "dd. MMM yyyy HH:mm")#The template above produces this output:
<b>Before:</b> 02. Nov 2026 09:20<br>
<b>After:</b> 07. Nov 2026 14:08