summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2017-03-02 19:10:58 +0530
committeradityacp2017-03-02 19:10:58 +0530
commit3c1abece2c1ba60c561c8e9258aef6e9e7525eba (patch)
tree48a2e20cbccc712fac394d7008f548ac28dfe171 /yaksh
parent28c4036a1c112f3e0e1bce2e1c0a0663aae21d11 (diff)
downloadonline_test-3c1abece2c1ba60c561c8e9258aef6e9e7525eba.tar.gz
online_test-3c1abece2c1ba60c561c8e9258aef6e9e7525eba.tar.bz2
online_test-3c1abece2c1ba60c561c8e9258aef6e9e7525eba.zip
Change js to convert seconds
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/monitor.html15
1 files changed, 8 insertions, 7 deletions
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index fbcca9c..d2c89ce 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -12,15 +12,16 @@
$(document).ready(function()
{
$("#result-table").tablesorter({sortList: [[5,1]]});
- var papers_length = "{{papers|length}}"
+ var papers_length = "{{papers|length}}";
for (var i=0; i < papers_length; i++){
var time_left = $("#time_left"+[i]);
- var date = new Date(null);
- date.setSeconds(time_left.text());
- var result = date.toISOString().substr(11, 8);
- time_left.text(result)
- }
- });
+ var time = time_left.text();
+ var hh = Math.floor(time / 3600);
+ var mm = Math.floor((time - (hh * 3600)) / 60);
+ var ss = time - (hh * 3600) - (mm * 60);
+ time_left.text(hh + ":" + mm + ":" + ss)
+ }
+});
</script>
{% endblock %}