How to get difference between Start Date and End Date when they're on 2 different forms
Posted: 23 Dec 2014
On New Form, I calculate the Start Time by startTime = new Date ();
On Edit Form, the end-user chooses a date for End Date, and on that field .change I want to calculate End Time by endTime = new Date();
Question: How do I access the startTime variable that was created on the New Form so that I can do the following on the Edit Form: startTime - endTime?
When these 2 variables are on the same form, I'm able to get the difference and output seconds/hours/days/etc. to my hearts content. But because they're on 2 separate forms, if I re-calculate the startTime it won't pick up the time that was originally on the new form.
I've tried outputting the startTime variable to a SharePoint field and do the following: fd.field('StartTime').value() - endTime, but I come back with a NaN.
Thank you.
On Edit Form, the end-user chooses a date for End Date, and on that field .change I want to calculate End Time by endTime = new Date();
Question: How do I access the startTime variable that was created on the New Form so that I can do the following on the Edit Form: startTime - endTime?
When these 2 variables are on the same form, I'm able to get the difference and output seconds/hours/days/etc. to my hearts content. But because they're on 2 separate forms, if I re-calculate the startTime it won't pick up the time that was originally on the new form.
I've tried outputting the startTime variable to a SharePoint field and do the following: fd.field('StartTime').value() - endTime, but I come back with a NaN.
Thank you.