function date_ampm_options in Date 7.2
Same name and namespace in other branches
- 7.3 date_api/date_api.module \date_ampm_options()
Constructs an array of AM and PM options without empty option.
Parameters
bool $key_upper: If TRUE then the array key will be uppercase.
bool $label_upper: If TRUE then the array value will be uppercase.
Return value
array An array of AM and PM options.
3 calls to date_ampm_options()
- DateObject::parse in date_api/
date_api.module - Converts a date string into a date object.
- date_ampm in date_api/
date_api.module - Constructs an array of AM and PM options.
- date_popup_process_time_part in date_popup/
date_popup.module - Process the time portion of the element.
File
- date_api/
date_api.module, line 1512 - This module will make the date API available to other modules.
Code
function date_ampm_options($key_upper, $label_upper) {
$am = $key_upper ? 'AM' : 'am';
$pm = $key_upper ? 'PM' : 'pm';
if ($label_upper) {
return array(
$am => t('AM', array(), array(
'context' => 'ampm',
)),
$pm => t('PM', array(), array(
'context' => 'ampm',
)),
);
}
else {
return array(
$am => t('am', array(), array(
'context' => 'ampm',
)),
$pm => t('pm', array(), array(
'context' => 'ampm',
)),
);
}
}