getDayOfWeek(); $date->addDays(-($dow + 6) % 7); return $date->format("%Y-%m-%d"); } ?>