You are here

function partial_date_month_abbreviations in Partial Date 7

Returns a translated array of short month names.

1 call to partial_date_month_abbreviations()
partial_date_format_component in ./partial_date.module

File

./partial_date.module, line 1146
Defines a date element that allows for any combination of date granularity settings.

Code

function partial_date_month_abbreviations($month) {
  static $month_names;
  if (empty($month_names)) {
    $month_names = array(
      1 => 'Jan',
      2 => 'Feb',
      3 => 'Mar',
      4 => 'Apr',
      5 => 'May',
      6 => 'Jun',
      7 => 'Jul',
      8 => 'Aug',
      9 => 'Sep',
      10 => 'Oct',
      11 => 'Nov',
      12 => 'Dec',
    );
    foreach ($month_names as $key => $month_name) {
      $month_names[$key] = t($month_name);
    }
  }
  if ($month) {
    return $month_names[$month];
  }
  return $month_names;
}