On a PDF sheet, I have a weekly table. I would like to enter the date of Monday and automate the dates from Tuesday to Sunday.
I already have a little script that works except when we change the month. if I enter the date of 08/29 I get 08/30 for Tuesday and 08/31 for Wednesday and after the script crashes because I can't get past 09/01.
Below is the script used :
var d = this.getField("Lundi").value;
var djs = util.scand("dd/mm/yyyy", d);
if (d != "" && djs != null) {
var day = djs.getDate() + 1;
var month = djs.getMonth() + 1;
var year = djs.getFullYear();
var de = month + "/" + day + "/" + year;
var dejs = util.scand("m/d/yyyy", de);
event.value = util.printd("dd/mm/yyyy", dejs);
}
else {
event.value = "";
}