Hi all,
I'm having some troubles with date fields. I'm using Livecycle Designer ES 8.2.1.x.x.x.x and programming in JavaScript
What I'm trying to achieve is to have the user enter in the start date of a contract, after specifying the length (drop down list of months), and it automatically calculates the end date of the contract.
For example:
User selects 36 months,
User selects start date of 20th February 2010
The form should automatically calculate the end date as 19th of February 2013.
At the moment I have 3 fields:
termLength
startDate
endDate
I have so far managed to calculate the milliseconds of the term.
I am calculating on field exit and setting the rawValue of read-only fields for the result.
What I think I should be doing is obtaining the millisecond value of the start date, adding the term length, and then converting back to a date format. Unfortunately I can't seem to get the millisecond value of the entered date, and nor do I know how to convert a millisecond value back to date format.
Any help would be greatly appreciated!
- Michael
Thought I'd add in some more info:
both startDate and endDate are date/time fields.
My current, unsuccessful code is as follows:
I know that the millisecond calculations work. I've tested them by outputting to a test text field.
I would really love some help on this!