You are here

function partial_date_month_names in Partial Date 7

Returns a translated array of month names.

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

File

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

Code

function partial_date_month_names($month) {
  static $month_names;
  if (empty($month_names)) {
    $month_names = array(
      1 => 'January',
      2 => 'February',
      3 => 'March',
      4 => 'April',
      5 => 'May',
      6 => 'June',
      7 => 'July',
      8 => 'August',
      9 => 'September',
      10 => 'October',
      11 => 'November',
      12 => 'December',
    );
    foreach ($month_names as $key => $month_name) {
      $month_names[$key] = t($month_name);
    }
  }
  if ($month) {
    return $month_names[$month];
  }
  return $month_names;
}