Commits

Seph Soliman  committed c78f60f

* round time and change debugging button. rounding still doesnt work correctly

  • Participants
  • Parent commits 2a9a073

Comments (0)

Files changed (2)

File src/js/widget.js

 function stopTimer() {
 	if(globalTimer.started) {
 		var e = globalTimer.getElapsed();
+		console.log(e);
 		var hours = roundNumber(e.hours + (e.minutes / 60) + (e.seconds / 60 / 60), 2);
+		//hours = roundHour(hours, HOUR_PRECISION); // rounding doesn't work correctly. 0.15 -> 0.91666
 		// * User may be trying to select something, so only change the value if needed.
 		if($("#reporthours").val() != hours.toString())
 			$("#reporthours").val(hours);
 	$("#time").text(globalTimer.toString());
 }
 
-// * Rounds an hour to the given precious, specified in minutes
+// * Rounds an hour to the given precision, specified in minutes
 function roundHour(hour, precision) {
 	var minutes = parseFloat(hour) * 60;
 	var rest = minutes % precision;

File src/widget.html

 				<span class="debug" onclick="$('#debug').slideToggle(250)" id="debugbtn"></span><br/>
 				<div class="debug" id="debug" style="display: none; width: 200px;">
 					<input type="button" value="Reload Projects" onclick="pullProjects()" />
-					<input type="button" value="Show report" onclick="$('#reportcontainer').show();" /><br/>
+					<input type="button" value="Add 1m" onclick="globalTimer.startTime -= 60*1000" /><br/>
 					
 					<input type="button" value="Get User Id" onclick="pullUserId()" />
 					<input type="button" value="Show front" onclick="showFront()" /><br/>