Your English is not terrible at all... It's actually very good. No need to apologize.
So when do you want the dates to update? When you open a file? When you click on a button in the file?
im sorrry, i make timesheet for pdf intearctive, thanks
var d = new Date(); while (d.getDay()!=1) d.setDate(d.getDate()+1); this.getField("Monday").value = util.printd("mm/dd/yyyy", d);
Oh God, finally, thanks...its working.
Could you help me again, im sorry i forgot, next day is tuesday, and i want to automatically fill it with the date, could you help me, im trying to google it and find this
date(); // call my function
var d = util.scand("mm/dd/yy", event.value); // retrieve the date from the Date1 field
var date2 = this.getField("Date2"); // creates a variable for the Date2 field
var d2 = d.valueOf(); // converts d2 to a number that we can calculate with
d2 += 1000 * 60 * 60 * 24 * 7; // adds 90 days (1000 miliseconds times 60 seconds times 60 minutes times 24 hours times 90 days
d3 = new Date(d2); // create a new date based on the d2 variable
date2.value = util.printd("dd mmmm yyyy", d3); // format and assign the new date variable to the Date2 field
but it doesnt work and the error messages always appear
Thank you...you are my hero
You can use the same code as above, just change the field name and this part:
For Wednesday use 3, Thursday 4, etc.
By the way, if you're interested, I've developed a script that allows you to set up such date calculations easily and without having to write any code. You can find it here: Custom-made Adobe Scripts: Acrobat -- Apply Automatic Date Calculation
1 person found this helpful
Ohhh.greattt..this is work, Thank you
I will inform my boss if he interested your usefull script, thank you
Hello, im sorry, i get a mistake, after i change the script to "d.getDay()!=2" for Tuesday, the date is 08/15/2017, what i mean is next day after first Monday after this day (08/22/2017)
Could you help me where is my mistake? thanks
Ah yes, I see the problem... In that case you can't use my code. You will need to add days to the original Monday date.
You can actually do it from the original script, like this:
var d = new Date(); while (d.getDay()!=1) d.setDate(d.getDate()+1); this.getField("Monday").value = util.printd("mm/dd/yyyy", d); d.setDate(d.getDate()+1); this.getField("Tuesday").value = util.printd("mm/dd/yyyy", d); d.setDate(d.getDate()+1); this.getField("Wednesday").value = util.printd("mm/dd/yyyy", d); // etc.
Greaattt...you really A maestro...its work..thanks