Display term or semester week numbers instead of year weeks

BobTheFish - September 3, 2009 - 14:29
Project:Calendar
Version:6.x-2.2
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Is there a way to modify the week numbers that appear down the left side of the calendar month view so that rather than being numbered weeks 1-52 they are numbered based on some other criteria?
This way the weeks could be labeled by the week number of the relevant term or semester, for an educational institution.

#1

jinit - September 4, 2009 - 07:35

You should change it from modules/calendar/incldes/calendar.inc file.

Function name is calendar_build_week(&$curday, $view, $items, $check_month = FALSE)

$rows[$week][] = array(
'data' => $weekno, // left side number is displaying from here.
'id' => $view->name . '-weekno-' . $curday_date,
'class' => 'week');

#2

BobTheFish - September 4, 2009 - 08:14

Ok, thanks, that helps!

Now my only problem is I'd like to use content to generate the dates.
I could use CCK to create a content type that has fields for the start and end dates of the terms, so that the administrator could change the dates without having to edit the actual code.

How would I make the calendar_build_week function load this data (e.g. the first node of that content type) for use in the php code?

#3

jaysonjust - November 7, 2009 - 11:38

Interested in this too.

 
 

Drupal is a registered trademark of Dries Buytaert.