These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

simple calendar calculation in JavaScript

goodbye
Registered: Jul 7 2008
Posts: 49
Answered

I searched the LiveCycle forum but to no avail.

I have two calendar fields and both should be editable by the end user, however, the second calendar should take the date specified by the user in the first and subtract 6 business days and display that date.

However, the user should still be able to adjust the second calendar. The calculated value is simply to offer a suggested date.

thanks in advance :)

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are a number of date and time calculations built into LiveCycle scripting. You need the XFA Object Reference and the FormCalc reference. You'll find them here:

http://partners.adobe.com/public/developer/xml/topic.php

Get these document and also try searching the forum for "Date Calculations".

Here's an article that explains date calculations using Core JavaScript functions. Which will work just fine in LiveCycle, although the article uses AcroForm examples.

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

goodbye
Registered: Jul 7 2008
Posts: 49
thank you for the links :)
R_Boyd
Registered: Nov 1 2007
Posts: 151
This link is broken

http://www.acrobatusers.com/tech_corner … ime_part1/

The working days calculator sample PDF does not seem to work in LCD 8.2 either. Is this to do with the difference between LCD and AcroForms?
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi R_Boyd,

Back in 2006 when that article was published there was an area of AUC called JavaScript Corner, but it no longer exists. A new area was set up titled Learning Center and all previous JavaScript Corner articles were reposted there with new links. Here is a link for that particular tutorial-
http://www.acrobatusers.com/tutorials/2006/date_time_part1

If you see links to tutorials in posts older than 2008 there is a decent chance they'll be broken so you'll have to search the Learning Center using words from the old link name in the Search tool there.

That series on Date and Time was based on AcroForms only, but as pointed out in the post above it is mostly Core JS which is used in both PDF forms technologies.

What Working Days Calculator are you referring to? We have one at www.pdfscripting.com but I don't think I've seen one here at AUC.

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com