Advertisement
Guest User

Untitled

a guest
May 2nd, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var originalProceedWeek = General.proceedOneWeek; //store the original function as a variable
  2. var myProceedWeek = function(company, customweek) //create a new function that will override the old one
  3. {
  4.     originalProceedWeek(company, customweek); //call the original we stored
  5.    
  6.     if (company.currentWeek < 1) { //check if the date is before 1/1/2
  7.         //do something at 1/1/1
  8.     }
  9.     else if (company.currentWeek > 0 && Math.floor(company.currentWeek) % 4 === 0) { //check if the date is later than 1/1/1 and the current week is divisible by 4, the number of weeks a month
  10.         //do something every month
  11.     }
  12. };
  13. General.proceedOneWeek = myProceedWeek; //replace the original function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement