Commit e41333c9 authored by robbertv's avatar robbertv

Added code to javascript file to format times greater than 60 minutes

parent 7ce559e6
......@@ -82,10 +82,10 @@ function formatTimeField(f,numDecimals){
var secondsPart = theTime.slice((2 + numDecimals) * -1,
theTime.length - numDecimals);
// Get the minutes time by getting the remaining characters
// Get the minutes time by getting the next one or two numbers
// excluding the last part (the seconds and decimal portion).
// If the time is less then minutesPart will be empty.
var minutesPart = theTime.slice(0,theTime.length - (2 + numDecimals));
var minutesPart = theTime.slice(theTime.length - (numDecimals + 4),theTime.length - (2 + numDecimals));
// If minutesPart is not empty, then format it to include
// the colon after the minute.
......@@ -93,8 +93,11 @@ function formatTimeField(f,numDecimals){
minutesPart = minutesPart + ":";
}
// Add the minutesPart, the secondsPart a period and the decimalsPart.
theTime = minutesPart + secondsPart + "." + decimalsPart;
var hoursPart = theTime.slice(0, theTime.length - (4 + numDecimals));
if(hoursPart) {
hoursPart = hoursPart + ":";
}
theTime = hoursPart + minutesPart + secondsPart + "." + decimalsPart;
}
// Set the form field value to theTime.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment