Hi, I have a modifier procedure to show the "date" of an event.
if($event['Event']['is_multi_day']){
if( date('n',strtotime($event['Event']['start_day']) ) == date('n',strtotime($event['Event']['end_day'])) )
$date = date('j',strtotime($event['Event']['start_day'])).' - '.
date('j',strtotime($event['Event']['end_day'])).' '.
date('M',strtotime($event['Event']['end_day']));
else
$date = date('j',strtotime($event['Event']['start_day'])).' '.
date('M',strtotime($event['Event']['start_day'])).' - '.
date('j',strtotime($event['Event']['end_day'])).' '.
date('M',strtotime($event['Event']['end_day']));
}else{
$date = date('j M', strtotime($event['Event']['start_day']));
}
I have to include that code block in every page I display an event. How do I define a function for this, which can be called from views I want?