Trying to make a javascript bookmark to add date of last sunday and date of next saturday

Im trying to make a javascript booklet and the web address stays mostly constant, just the date changes

I HAVE THIS by adapting an old bookmark to work for this:

javascript:function url(){          
var date = new Date();                
var m = date.getMonth()+1;         
var d = date.getDate();     
var y = date.getYear();   
var h = date.getHours();   
var hs = date.getHours()-1;      
if(m < 10){m = '0' + m;}         
if(d < 10){d = '0' + d;}          
return 'XXXXXX'+ y +'-' + m + '-' + d + 'XXXXX' + y + '-' + m + '-' d + 'xxxxxx';  } window.open(url(),"_parent");

I need the output to be EXAMPLE: website.com/2024-02-04/info/2024-02-10/stuff
where the only things that need to be updated are the dates and if they can auto load this weeks first day of the week (sunday) and this weeks last day of the week (saturday)

javascipt and booklets are new to me so please forgive my knowledge gaps