Drupal - changing the calander view to display single letter for day of the week
30th Nov 2007
Mike Dixon
Senior Mind
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?
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){
$item['data']=substr($item['data'],0,1);
$new_header[] =$item;
}
return theme_event_calendar_month($op, $new_header, $rows, $attributes, $caption);
}