Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
when going to Year view the links
- Month leads to 12
- Week to W49
- Day to 21-01
to fix the dates i try this:
[calendar.main.tpl.php]
<div class="calendar-calendar">
<?php if (!empty($calendar_popup)) print $calendar_popup;?>
<?php if (!empty($calendar_add_date)) print $calendar_add_date; ?>
<?php // if (empty($block)) print theme('links', $calendar_links);?>
<?php // added:
$current_year = date('Y');
$current_month = date('m');
$current_week = date('W');
$current_day = date('d');
print l("Year", "/calendar/". $current_year);
print l("Month", "/calendar/". $current_year . "-" . $current_month);
print l("Week", "/calendar/". $current_year . "-W" . $current_week);
print l("Day", "/calendar/". $current_year . "-" . $current_month . "-" . $current_day);
?>
<?php print theme('date_navigation', $view) ?>
</div>
but the Week links to one week before the current week
(links to 2011-W26 but the current now is 2011-W27)
also try this with no success:
$current_week = strftime("%V",strtotime("07/02/2011"));
always the week is one before.
So, is this way a right approach for solving the problem?
If yes, the solution could be to just add +1 to the week number or this could give a wrong week number again? (in future)
If no, is there any other way to calculate the current week number?
Comments
Comment #1
Neslee Canil PintoThe D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.