How to calculate next Friday's date in Acroform Javascript?

Acrobat Pro v8.12
Acroforms/ WIN

Greetings All;

How can I calculate next Friday's date in Acroform Javascript?

These formulas calculate next Friday's date in VBA and/or Excel:


Where $C$4 = today's date

     VBA Version                                     Excel version
=DATE-WEEKDAY(DATE, 2)+12      =$C$4-WEEKDAY($C$4, 2)+12

This formula will calculate today's date in Acroform Javascript
for the Text2 textfield:


var d = new Date();
var sDate = util.printd("mm/dd/yyyy", d);
this.getField("Text2").value = sDate;


How can I modify it to calculate next Friday's date in Acroform Javascript?

Thanks, in advance, for your time and consideration.
´*•.¸(`*•.¸?¸.•*´)¸.•*´
?*°Doris 42DoubleDDs*°•´»?
.¸.•*(¸.•*´?`*•.¸) *•.¸


DMackalliiAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
Some links :
http://www.w3schools.com/jsref/jsref_getday.asp
http://www.w3schools.com/jsref/jsref_setdate.asp
http://www.w3schools.com/jsref/jsref_getdate.asp

You may use :

d = new Date();
x = 5 - d.getDay();
d.setDate(d.getDate() + x);
var sDate = util.printd("mm/dd/yyyy", d);
this.getField("Text2").value = sDate;

Open in new window

0
 
DMackalliiAuthor Commented:
03/27/11

leakim971.....

That has to be a record! (Both in the simplicity of your solution and the promptness of your response.

Thank you soooo much!
´*•.¸(`*•.¸?¸.•*´)¸.•*´
?*°Doris 42DoubleDDs*°•´»?
.¸.•*(¸.•*´?`*•.¸) *•.¸
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.