Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DayIncrement(offset, workDaysOnly) {
- var today = new Date();
- var tomorrow = new Date();
- offset += Math.floor(offset/7)*2;
- if ( (workDaysOnly)&&(offset<7) ){
- if ( (today.getDay()+offset)>5 ){
- offset = offset + 2;
- }else if( today.getDay()==6 ){
- offset = offset + 1;
- }
- }
- tomorrow.setDate(today.getDate()+offset);
- var day = tomorrow.getDate();
- var month = tomorrow.getMonth()+1;
- switch(month)
- {
- case 1: month="января";break; case 2: month="февраля";break; case 3: month="марта";break;
- case 4: month="апреля";break; case 5: month="мая";break; case 6: month="июня";break;
- case 7: month="июля";break; case 8: month="августа";break; case 9: month="сентября";break;
- case 10: month="октября";break; case 11: month="ноября";break; case 12: month="декабря";break;
- }
- return day + " " + month;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement