Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var time = {
- "Jakub P": {completed: 0, all: 0, ti: 0, tc: 0},
- "Konrad S": {completed: 0, all: 0, ti: 0, tc: 0},
- "Marcin K": {completed: 0, all: 0, ti: 0, tc: 0},
- "Radoslaw W": {completed: 0, all: 0, ti: 0, tc: 0}
- };
- if ($("#ticket-table").length > 0) {
- $("#ticket-table tbody tr").each(function(){
- td = $(this).find('td.estimated_time span');
- as = $(this).find('td.assignee a').text();
- t = $(td).html();
- ti = 0;
- if (t !== undefined && time[as] != undefined) {
- if (t.indexOf("mins") >= 0) {
- t.replace(" mins", "");
- ti = parseInt(t);
- } else {
- t = t.replace(" hrs", "");
- t = t.replace(" hr", "");
- ti = parseInt(t) * 60;
- }
- time[as].ti += 1;
- time[as].all += ti;
- if ($(this).find('span.status').html().indexOf('Completed') >= 0) {
- time[as].completed += ti;
- time[as].tc += 1;
- }
- }
- });
- for (var i in time) {
- $(".meta-ticket-header__count").append(i + ":<b>" + time[i].tc + "/" + time[i].ti + "/" + time[i].completed + '/' + time[i].all + "</b>, ");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement