Browse Source

Add clock

pull/6/head
Edward Ribeiro 9 years ago
parent
commit
8b15aa8645
  1. 21
      templates/painel/index.html

21
templates/painel/index.html

@ -22,6 +22,26 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
//TODO: replace by a fancy jQuery clock
function checkTime(i) {
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
function startTime() {
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m = checkTime(m);
s = checkTime(s);
$("#clock").text(h+":"+m+":"+s)
var t = setTimeout(function(){
startTime()
},500);
}
startTime();
var counter = 1; var counter = 1;
(function poll() { (function poll() {
$.ajax({ $.ajax({
@ -82,6 +102,7 @@
<span id="sessao_plenaria"></span><br/> <span id="sessao_plenaria"></span><br/>
<span id="sessao_plenaria_data"></span><br/> <span id="sessao_plenaria_data"></span><br/>
<span id="sessao_plenaria_hora_inicio"></span></br> <span id="sessao_plenaria_hora_inicio"></span></br>
<h2><span id="clock"></span></h2>
<table> <table>
<tr> <tr>
<td> <td>

Loading…
Cancel
Save