How to get next week date in TypeScript

1 Answer

0 votes
function nextweek() {
    const today = new Date();
    const nextweek = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7);
    
    return nextweek;
}

console.log(nextweek().toDateString());


  
  
  
  
/*
run:
  
"Sat Apr 09 2022" 
  
*/

 



answered Apr 2, 2022 by avibootz
...