0 Replies Latest reply on Feb 26, 2015 1:13 AM by LauraMG

    Minus Time Calculation

    LauraMG

      I am working on a daily time sheet, I have the total box which adds up the time of various tasks done that day, but under the total field I need to minus 30 minutes from the total and show the answer in that field.

       

      TotalBasicHours

       

      var fields=["Total Basic HoursRow1","Total Basic HoursRow2","Total Basic HoursRow3","Total Basic HoursRow4","Total Basic HoursRow5","Total Basic HoursRow6","Total Basic HoursRow7"];

       

      var times = [];

       

      for(var i=0; i<fields.length; i++) {

       

                var fieldvalue = fields[i];

       

                time = Time2Min(this.getField(fieldvalue).value);

       

              times.push(time);

       

      }

       

      event.value = '';

       

      event.value = Min2HHMM(eval(times.join('+')));

       

      Under this field is Minus30min, it is this box I want to minus 30 minutes from the total in TotalBasicHours


      Please help, I have looked all over and I can't find a script I can copy (I am new to JavaScript)....