Posted by hujia on June 4, 2009 at 4:16pm
Jump to:
| Project: | Calendar |
| Version: | 6.x-2.0-rc6 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
Comments
#1
+1
#2
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.
<?phpfunction 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
#3
Solution provided....
#4
Automatically closed -- issue fixed for 2 weeks with no activity.
#5
Wouldn't this be better?
<?php$format = ($granularity=='month') ? 'F Y' : $format;
?>