public static DateHelper::ampm($required = FALSE)
Constructs an array of AM and PM options.
Parameters
bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.
Return value
array An array of AM and PM options.
File
- core/lib/Drupal/Core/Datetime/DateHelper.php, line 437
Class
- DateHelper
- Defines Gregorian Calendar date values.
Namespace
Drupal\Core\Datetime
Code
1 2 3 4 5 6 7 8 | public static function 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 ; } |
Please login to continue.