Hi,
you have to use this script in the exit-event from the user input-date-field. This script is correct for a subtraction. (without error messages )
if(this.rawValue != null)
{
var sDate = util.scand("yyyy-mm-dd", this.rawValue);
//THE SEVEN IN THE END OF THE LINE YOU CAN CHANGE WHEN YOU WISH TO ADD MORE OR LESS DAYS
var NewsDate = Number(sDate) - (24*60*60*1000*7);
var nDate = util.printd("dd.mm.yyyy", new Date(NewsDate));
//DatumsUhrzeitfeld2 --> YOUR TARGET FIELD --> PLEASE CHANGE THE NAME IN YOURS
DatumsUhrzeitfeld2.rawValue = nDate;
}
I hope it's helpful for you?
Kind regards
Mandy