The Year for the Calendar Block?

hujia - June 4, 2009 - 16:16
Project:Calendar
Version:6.x-2.0-rc6
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

For the Calendar block on the side, the top title bar only shows the Month: I think it needs to show the Year (YYYY), both for the current one and any year that the user navigates to. Is there a way I could add this myself in its module files? Please advise. Thanks, Huj.

#1

arlinsandbulte - September 19, 2009 - 17:23
Priority:critical» normal
Status:needs work» active

+1

#2

Bitvark - October 14, 2009 - 15:25

Hi,
here is a solution:

You need to create your theme function (my_theme_name_date_nav_title()) overriding theme_date_nav_title() function in modules/date/theme/theme.inc

Just sobstitute my_theme_name with appropriate value and copy this function in template.php in your theme folder.

<?php
function my_theme_name_date_nav_title($granularity, $view, $link = FALSE, $format = NULL) {
$format = ($granularity=='month') ? 'F Y' : NULL;
$output = theme_date_nav_title($granularity, $view, $link, $format);
return
$output;
}
?>

Drupal 7: See http://drupal.org/node/400292 - things may be different!

Bye
Bitvark

 
 

Drupal is a registered trademark of Dries Buytaert.