U
UGD Studios
I hope you can help me.
I have very little knowledge of XPath code or JScript Code and I am getting
quite frustrated making my form functional. I have an invoice that I have
created that tracks not only expenses but my hours worked (i am an
independent contractor). I have seen the sample time cards that come with
InfoPath, but I can't seem to find the code that makes them work (perhaps it
has been hidden by the software developers for just this reason).
Anyways, I recently read a thread on the MSDN InfoPath Team Blog called
'Calculating Elapsed Time...without code' at
http://blogs.msdn.com/infopath/archive/2007/02/21/calculating-elapsed-time-without-code.aspx
I tried the examples applied to my form and everything worked fine except
for one major problem. If the time period extends past midnight, it returns
a negative integer for the total time. Ex: If I clock in at 4 PM and clock
out at 2AM, I have worked for 10.00 hours, but I receive -14.00 hours in the
total hours.
So I left a comment on the thread for the author, Scott Heim, asking for any
advice. He responded that it would be easier to do a calculation like that
with custom code.
After a few Google searches, I came across your thread 'Calculating Time
Differences With Custom JScript Code'. I read through the article and tried
the example and had the same results.
How can I get this to work?? HELP:???
Now, I read in the notes of the .js file I downloaded that the 'function
calcTimeInMinutes' function 'Calculates the elapsed time given a start time
and end time in the "hh:mm" time format. Since date calculations are not
being done, the date has been set to January 1, 1970.'
Does that mean that if I were to enter the date of when I clocked in instead
of January 1, 1970, it would work? If so, how do I do that? The code for
that section wasn't exactly 'straight-forward' to someone unfamilliar with
the language. Also, is there just a way to extract that data from the date
field that I have in the repeating table so it figures it out automatically?
That would be the best for my application.
I appreciate any help you can give me. Also if you have any suggestions on
reading material or books I should get to learn these code languages.
Thank you so much.
~Geoff
I have very little knowledge of XPath code or JScript Code and I am getting
quite frustrated making my form functional. I have an invoice that I have
created that tracks not only expenses but my hours worked (i am an
independent contractor). I have seen the sample time cards that come with
InfoPath, but I can't seem to find the code that makes them work (perhaps it
has been hidden by the software developers for just this reason).
Anyways, I recently read a thread on the MSDN InfoPath Team Blog called
'Calculating Elapsed Time...without code' at
http://blogs.msdn.com/infopath/archive/2007/02/21/calculating-elapsed-time-without-code.aspx
I tried the examples applied to my form and everything worked fine except
for one major problem. If the time period extends past midnight, it returns
a negative integer for the total time. Ex: If I clock in at 4 PM and clock
out at 2AM, I have worked for 10.00 hours, but I receive -14.00 hours in the
total hours.
So I left a comment on the thread for the author, Scott Heim, asking for any
advice. He responded that it would be easier to do a calculation like that
with custom code.
After a few Google searches, I came across your thread 'Calculating Time
Differences With Custom JScript Code'. I read through the article and tried
the example and had the same results.
How can I get this to work?? HELP:???
Now, I read in the notes of the .js file I downloaded that the 'function
calcTimeInMinutes' function 'Calculates the elapsed time given a start time
and end time in the "hh:mm" time format. Since date calculations are not
being done, the date has been set to January 1, 1970.'
Does that mean that if I were to enter the date of when I clocked in instead
of January 1, 1970, it would work? If so, how do I do that? The code for
that section wasn't exactly 'straight-forward' to someone unfamilliar with
the language. Also, is there just a way to extract that data from the date
field that I have in the repeating table so it figures it out automatically?
That would be the best for my application.
I appreciate any help you can give me. Also if you have any suggestions on
reading material or books I should get to learn these code languages.
Thank you so much.
~Geoff