Browse Source

! Don't cause undefined index errors when viewing January of the min year or December of the max year

Signed-off-by: Michael Eshom <oldiesmann@oldiesmann.us>
Michael Eshom 11 years ago
parent
commit
3fde3e792d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Themes/default/Calendar.template.php

+ 2 - 2
Themes/default/Calendar.template.php

@@ -282,9 +282,9 @@ function template_show_month_grid($grid_name, $is_mini = false)
 			// Otherwise, assuming it's not a mini-calendar, we can show previous / next month days!
 			elseif ($is_mini === false)
 			{
-				if ($current_month_started === false)
+				if ($current_month_started === false && !empty($context['calendar_grid_prev']))
 					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_prev']['current_year'], ';month=', $context['calendar_grid_prev']['current_month'], '">', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- + 1, '</a>';
-				else
+				elseif (!empty($context['calendar_grid_next']))
 					echo '<a href="', $scripturl, '?action=calendar;year=', $context['calendar_grid_next']['current_year'], ';month=', $context['calendar_grid_next']['current_month'], '">', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '</a>';
 			}