Help for this page
$days_to_first_monday = ($dow + 7 - 1) % 7;
$days_to_last_friday = ($dow + 7 - 5) % 7 - 7;