You are here

function date_ampm in Date 7

Same name and namespace in other branches
  1. 5.2 date_api.module \date_ampm()
  2. 6.2 date_api.module \date_ampm()
  3. 6 date_api.module \date_ampm()
  4. 7.3 date_api/date_api.module \date_ampm()
  5. 7.2 date_api/date_api.module \date_ampm()

An array of am and pm options.

Parameters

$required: If not required, returned array will include a blank value.

Return value

array an array of am pm options.

1 call to date_ampm()
date_parts_element in date_api/date_api_elements.inc
Create form elements for one or more date parts.

File

date_api/date_api.module, line 989
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_ampm($required = FALSE) {
  $none = array(
    '' => '',
  );
  $ampm = array(
    'am' => t('am', array(), array(
      'context' => 'ampm',
    )),
    'pm' => t('pm', array(), array(
      'context' => 'ampm',
    )),
  );
  return !$required ? $none + $ampm : $ampm;
}