0

Drupal 7.14 - Calendar Module 7.x-3.4

Does anyone have an idea how to display the dates alongside the week days on the week views block?

3
  • did you find any solution for this issue?
    – Aboodred1
    Jan 22, 2013 at 2:21
  • Unfortunately, I did not. Jan 24, 2013 at 11:08
  • I found a solution while playing around with calendar module, I'll post it in the answer section.
    – Aboodred1
    Jan 24, 2013 at 19:13

1 Answer 1

1

First you need to copy calendar-week-overlap.tpl.php from calendar/theme to your custom Drupal theme and add the following lines:

Add this code before html code - after line 30

$start_date = date_format($view->date_info->min_date, 'U'); 

After line 40 <th class="calendar-agenda-hour">&nbsp;</th> replace the following code

 <?php foreach ($day_names as $cell): ?>
    <th class="<?php print $cell['class']; ?>" id="<?php print $cell['header_id']; ?>">
      <?php print $cell['data']; ?>
    </th>
  <?php endforeach; ?>

with this code

<?php $i = 0; foreach ($day_names as $cell): ?>
    <th class="<?php print $cell['class']; ?>" id="<?php print $cell['header_id']; ?>">
      <?php print $cell['data']; ?>, <?php print date('d/m/Y', strtotime("+$i day", $start_date)); $i++ ?>
    </th>
  <?php endforeach; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.