Author image
Senior Mind

Drupal - changing the calander view to display single letter for day of the week

By default the Drupal event module will provide a nice calander block, listing the days of the week accross the top using 3 letter abbreviations (mon, tue etc).

This little theme snippet will override this default behaviour and display the first letter of each day of the week (i.e. M T W) etc.

Pop the following into your template.php file and you should be in business

function phptemplate_event_calendar_month($op, $header, 
$rows, $attributes = array(), $caption = NULL) {
  //run through each item in the old header and just use the first letter
//instead of the entire word
  foreach ($header as $item){
    $new_header[] =$item;
  return theme_event_calendar_month($op, $new_header, $rows, $attributes, $caption);