Here is a little script that should give you a pointer towards solving your 6 week issue.
Names Default To Here( 1 );
// put in any date using the format of mm/dd/yyyy
inDate = "07/21/2021";
jmpDate = Informat( inDate, "mm/dd/yyyy" );
// Calculate the date 6 weeks before, and adjust to the
// Sunday prior to the absolute 6 week date
sixWeeksBefore = jmpDate - In Weeks( 6 ) - In Days( Day Of Week( jmpDate ) - 1 );
// Calculate the date 6 weeks after, and adjust to the
// Sunday following
sixWeeksAfter = jmpDate + In Weeks( 6 ) + In Days( 8 - Day Of Week( jmpDate ) );
Dialog(
"Input date is: " || Long Date( jmpDate ),
"6 weeks before is: " || Long Date( sixWeeksBefore ),
"6 weeks after is: " || Long Date( sixWeeksAfter )
);
Look in the Scripting Index for help with the different functions.
Jim