I am fairly new at both Acrobat AND Javascript. Can anyone tell me how to use it in a field? Do I need to cal a function in the field? I'm using dates that are formatted in the field-do I need to include the format in the script? I'm MORE than a little confused....
As to dates, dates are character strings and nothing more. If you want to do perform date arithmetic, you either need to split the month, day and year from the string and then manipulate each piece. Or you need to convert the date string to a date object and then use the properties to obtain the specific data you need for additional processing.
If this is an early attempt at writing JS, date arithmetic is fairly complex and you might want to learn more about how JS works on simple calculations before you start trying to manipulate date and time.
For example:
Exactly, how many days are in a week?
Exactly, how many days are in a month?
Exactly, how many days are in a year?
The only item with an answer in a whole number is 7 days in a week.
There is no exact number of days in a month. And for February there is no consistent number of days in that month. Every four years there is an extra day , except for most centuries which 3 of 4 are not leap years.
For time sheets I use fictions because there is a lot of repeated code for computing the difference between the start and end of the many time periods. And then there is the special formatting needed to display the result for each day.
George Kaiser