Hi, excellent module.

I have two main issues now: I would like to drop the week view, and have just year, month and day views... I would also settle for simply erasing the 'week' link, how can I get it?

Also, I'd need the calendar to show the current locale's names for dates and months... I notice that day headers in calendars are the right ones (guess they are not hard coded but rather gathered from the environment), but dates and month headings are not. Can I set it in some way?

An issue maybe linking the above two: how do I change the names of the links "year | month | week | day"? I'd need to have them in a different language (maybe even depending on the current locale of the person viewing the site?).

Thanks in advance!

Comments

mphilipp’s picture

Hi,

I'm not a module developer, but had about the same issues. The only way to drop the week view is IMHO to comment out a line in calendar.module:
$calendar_links[] = array('title' => t('Week'), 'href' => $view->url .'/'. $view->year .'/W'. $week, 'query' => $append);

The problem with month names and so on is, that PHP's gmdate() is used to format them instead of Drupal's format_date() function. To achive localization all occurrences of gmdate($format, $timestamp) (or at least those where one of the letters 'AaDFlM' is in the format string) must be replaced with format_date($timestamp, 'custom', $format, 0).

The strings for the Links "year | month | week | day" can be translated using Drupal's build-in localization. Use administer >> localization >> manage strings.

Lowell’s picture

Thanks to mphillip, I was looking for that.

An additional change to the calender.api.inc will effectively disable the week numbers on the left of the calendar view.


                      'data' => l(sprintf('%02d', $cur_week), $params['url'] .'/'. $year .'/'. $month),
//                      'data' => l(sprintf('%02d', $cur_week), $params['url'] .'/'. $year .'/W'. $cur_week),

This is near the end of the first function in the file. It is a long function, so just scroll down to find this line

KarenS’s picture

Status: Active » Fixed

In the very latest commit, the navigation and Year/Month/Day/Week links have been moved into a theme that can be overridden (and you can hide one or more of the links if you like), and all themes have been moved into a separate file to make them easier to find.

redsun82’s picture

Thank you all!

Anonymous’s picture

Status: Fixed » Closed (fixed)