Insert current date
A variable action can be used to automatically insert the current date into a customizable document. Within that action, JavaScript is used to retrieve the date and format it properly.
Summary
Action type: Validate (In the Actions tab, edit Validate.)
Variable: Short text and set to visible
Action code:
1 if variable InsertDate visible is true
2 set variable InsertDate visible is false
3 set variable InsertDate value = JavaScript eval long string 'JavaScript code
4 end if
How it works
Create a short text variable called InsertDate. Make sure it is visible each time you save the document.
Create a Validate action that contains the action code above.
In the action, this is the code you could use for 'JavaScript code':
var d = new Date();
var day = ("0" + d.getDate()).slice(-2);
var month = ("0" + (d.getMonth() + 1)).slice(-2);
var year = d.getFullYear();
return year + "-" + month + "-" + day;
Or this JavaScript code which only adds the month and year:
return [01,02,03,04,05,06,07,08,09,10,11,12]
[(new Date()).getMonth()] + '-' + (new Date()).getFullYear();
doc. version 6.0.4