Commit 00903ffa authored by Vinicius Ruoso's avatar Vinicius Ruoso

Created set_date function to show current date on SDI bar.

This function create a Date element, and set the inner HTML of element
to a beauty formated date string.

Now, this feature will be used on SDI top bar.
Signed-off-by: default avatarVinicius Ruoso <vkr07@c3sl.ufpr.br>
parent 06c190f9
......@@ -5,6 +5,9 @@ function populate(){
var tbls = document.getElementsByTagName('table');
var row;
var cols;
// fill sdi bar date field
set_date('date');
for (var tb=0; tb<tbls.length; tb++) {
row = tbls[tb].getElementsByTagName('tr');
......@@ -47,6 +50,17 @@ function populate(){
}
}
function set_date(elementID){
var Months = new Array('janeiro', 'fevereiro', 'março', 'abriu',
'maio', 'junho', 'julho', 'agosto', 'setembro',
'outubro', 'novembro', 'dezembro')
var now = new Date();
element = document.getElementById(elementID);
element.innerHTML = now.getDate() + " de " + Months[now.getMonth()-1] +
" de " + now.getFullYear();
}
function paint(table){
var tbl = document.getElementById(table);
var rows = tbl.getElementsByTagName('tr');
......
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