Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var originalProceedWeek = General.proceedOneWeek; //store the original function as a variable
- var myProceedWeek = function(company, customweek) //create a new function that will override the old one
- {
- originalProceedWeek(company, customweek); //call the original we stored
- if (company.currentWeek < 1) { //check if the date is before 1/1/2
- //do something at 1/1/1
- }
- 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
- //do something every month
- }
- };
- General.proceedOneWeek = myProceedWeek; //replace the original function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement