Jump a week from another date


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function bounce() {
  2. d = document.periodsel;
  3.  
  4. var bog = new Array();
  5. bog = d.date1a.value.split("-");
  6. ra = bog[0];
  7. re = bog[1]-1;
  8. ro = bog[2];
  9.  
  10. dod = new Date(ra,re,ro);
  11. domo = dod.getMonth()+1;
  12. doda = dod.getDate()+6;
  13.  
  14. if(doda <= '9')
  15. doda = '0'+doda;
  16.  
  17. ere = dod.getFullYear()+'-'+domo+'-'+doda;
  18.  
  19. d.date1b.value = ere;
  20. return true;
  21. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.