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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JScript

From novice to tech pro — start learning today.