You are here

function theme_date_views_browser_period_label in Date 5.2

Same name and namespace in other branches
  1. 5 date_views.inc \theme_date_views_browser_period_label()
  2. 6 date/date.theme \theme_date_views_browser_period_label()

Theme for the current period label name

1 theme call to theme_date_views_browser_period_label()
date_views_browser_period_label in date/date_views.inc
Return label for current date range

File

date/date.theme, line 169
Theme functions.

Code

function theme_date_views_browser_period_label($period, $date) {
  switch ($period) {
    case 'year':
      $format = 'Y';
      break;
    case 'month':
      $format = 'F Y';
      break;
    case 'week':
    case 'day':

      // Use just the year/month/day part of the short date format.
      $format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array(
        'month',
        'day',
        'year',
      ));
      break;
    case 'hour':

      // Use just the year/month/day/hour part of the short date format.
      $format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array(
        'month',
        'day',
        'year',
        'hour',
      ));
      break;
  }
  return t('%period of %date', array(
    '%period' => ucwords($period),
    '%date' => date_format_date($date, 'custom', $format),
  ));
}