Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var totalWorkedTime = 0;
- var hoursInMinutes = 0;
- var tminutes = 0;
- var daysYouHaveToWork = 0;
- var timeForMoreWork = 0;
- var theDoorsTableBro = $('.table-striped');
- var TalkToTheHandAboutTime = function()
- {
- $(theDoorsTableBro[0].children[1].children).each(function(index, element){
- var time = element.childNodes[1].childNodes[0];
- if(time != undefined && time.length == 5){
- daysYouHaveToWork++;
- var hours = time.data.substr(0,2);
- var minutes = time.data.substr(3,5);
- hoursInMinutes += hours * 60;
- tminutes += minutes * 1;
- console.log(element.childNodes[1].childNodes[0]);
- }
- });
- totalWorkedTime = hoursInMinutes + tminutes;
- timeForMoreWork = totalWorkedTime - (450 * daysYouHaveToWork);
- showTimesNow();
- }
- var showTimesNow = function(){
- console.log('Number of days that you have attended at the office without forgotten chip is ' + daysYouHaveToWork);
- console.log('Your worked total time is ' + totalWorkedTime + ' minutes' );
- var mess = timeForMoreWork >= 0 ? ("You have worked " + timeForMoreWork+ " minutes more than needed") : ("You have worked " + timeForMoreWork+ " minutes less than needed :( . You have to overwork " + Math.abs(timeForMoreWork)+" more minutes to fix it.");
- console.log(mess);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement