Download & Extend

The Year for the Calendar Block?

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

Priority:critical» normal
Status:needs work» active

+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.

<?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

#3

Status:active» fixed

Solution provided....

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#5

Wouldn't this be better?

<?php
$format
= ($granularity=='month') ? 'F Y' : $format;
?>