Zero-pad seconds in time output
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 22 Sep 2011 15:39:32 -0600
changeset 623 e65c152295e3
parent 622 b94bc4cceb61
child 624 3e3d9d45098e
Zero-pad seconds in time output
conformancetest/gentest.html
conformancetest/runtest.html
conformancetest/splitruntest.html
--- a/conformancetest/gentest.html	Thu Sep 22 15:13:34 2011 -0600
+++ b/conformancetest/gentest.html	Thu Sep 22 15:39:32 2011 -0600
@@ -76,7 +76,9 @@
 		.removeChild(document.getElementById("test-container"));
 	var elapsed = Math.round(Date.now() - startTime)/1000;
 	document.getElementById("timing").textContent =
-		"Time elapsed: " + Math.floor(elapsed/60) + ":" + (elapsed % 60).toFixed(3) + " min.";
+		"Time elapsed: " + Math.floor(elapsed/60) + ":"
+		+ ((elapsed % 60) < 10 ? "0" : "")
+		+ (elapsed % 60).toFixed(3) + " min.";
 	document.querySelector("[type=submit]").disabled = false;
 }
 
--- a/conformancetest/runtest.html	Thu Sep 22 15:13:34 2011 -0600
+++ b/conformancetest/runtest.html	Thu Sep 22 15:39:32 2011 -0600
@@ -41,6 +41,8 @@
 
 	var elapsed = Math.round(Date.now() - startTime)/1000;
 	document.getElementById("timing").textContent =
-		"Time elapsed: " + Math.floor(elapsed/60) + ":" + (elapsed % 60).toFixed(3) + " min.";
+		"Time elapsed: " + Math.floor(elapsed/60) + ":"
+		+ ((elapsed % 60) < 10 ? "0" : "")
+		+ (elapsed % 60).toFixed(3) + " min.";
 }
 </script>
--- a/conformancetest/splitruntest.html	Thu Sep 22 15:13:34 2011 -0600
+++ b/conformancetest/splitruntest.html	Thu Sep 22 15:39:32 2011 -0600
@@ -84,6 +84,8 @@
 
 	var elapsed = Math.round(Date.now() - startTime)/1000;
 	document.getElementById("timing").textContent =
-		"Time elapsed: " + Math.floor(elapsed/60) + ":" + (elapsed % 60).toFixed(3) + " min.";
+		"Time elapsed: " + Math.floor(elapsed/60) + ":"
+		+ ((elapsed % 60) < 10 ? "0" : "")
+		+ (elapsed % 60).toFixed(3) + " min.";
 })();
 </script>