This article describes a Java script that calculates a future date, based on a date passed to a field on the label.
The script parses the date passed to the label and then can be configured to add a specified number of days to the date which is passed into a new field on the label. The script used in ExpirationDateSample.lwl (attached) is below:
var input = String(label.fields.field.(@name == 'Date_Input').@data);
var twomonth = input.substr(0,2);
var twoday = input.substr(2,2);
var fouryear = input.substr(4,4);
var twoyear = input.substr(6,2);
javadate = new Date(fouryear,(twomonth -1),twoday);
javadate.setDate(javadate.getDate()+3) //today now is set to be 3 days into the future
The sample label requires a date format of mmddyyyy, the output is configured to print into a paragraph field which can be modified.