Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here's a block that you can use to do something on a particular day of the week (Monday, Tuesday, Wednesday, etc.). Can be easily adapted for other date intervals based on the php date function. Enjoy.
$day_of_week = date("l", mktime());
switch ($day_of_week) {
case "Monday":
//do whatever
print "<h2>Today is Monday</h2>";
break;
case "Tuesday":
//do whatever
print "<h2>Today is Tuesday</h2>";
break;
case "Wednesday":
//do whatever
print "<h2>Today is Wednesday</h2>";
break;
case "Thursday":
//do whatever
print "<h2>Today is Thursday</h2>";
break;
case "Friday":
//do whatever
print "<h2>Today is Friday</h2>";
break;
case "Saturday":
//do whatever
print "<h2>Today is Saturday</h2>";
break;
case "Sunday":
//do whatever
print "<h2>Today is Sunday</h2>";
break;
}