The following function calculates the date for the Monday that follows the specified date:

function nextMonday(dArg)

   if dow(dArg) == 1 // If it's Sunday 

      return dArg + 1 // Monday is the next day 

   else // Otherwise, subtract DOW() 

      return dArg - dow(dArg) + 9 // to get last week Saturday 

   endif // then add 9 for next week Monday