public static DateHelper::monthNamesAbbr($required = FALSE)
Constructs a translated array of month name abbreviations
Parameters
bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE.
Return value
array An array of month abbreviations.
File
- core/lib/Drupal/Core/Datetime/DateHelper.php, line 112
Class
- DateHelper
- Defines Gregorian Calendar date values.
Namespace
Drupal\Core\Datetime
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public static function monthNamesAbbr( $required = FALSE) { // Force the key to use the correct month value, rather than // starting with zero. $monthnames = array ( 1 => t( 'Jan' , array (), array ( 'context' => 'Abbreviated month name' )), 2 => t( 'Feb' , array (), array ( 'context' => 'Abbreviated month name' )), 3 => t( 'Mar' , array (), array ( 'context' => 'Abbreviated month name' )), 4 => t( 'Apr' , array (), array ( 'context' => 'Abbreviated month name' )), 5 => t( 'May' , array (), array ( 'context' => 'Abbreviated month name' )), 6 => t( 'Jun' , array (), array ( 'context' => 'Abbreviated month name' )), 7 => t( 'Jul' , array (), array ( 'context' => 'Abbreviated month name' )), 8 => t( 'Aug' , array (), array ( 'context' => 'Abbreviated month name' )), 9 => t( 'Sep' , array (), array ( 'context' => 'Abbreviated month name' )), 10 => t( 'Oct' , array (), array ( 'context' => 'Abbreviated month name' )), 11 => t( 'Nov' , array (), array ( 'context' => 'Abbreviated month name' )), 12 => t( 'Dec' , array (), array ( 'context' => 'Abbreviated month name' )), ); $none = array ( '' => '' ); return ! $required ? $none + $monthnames : $monthnames ; } |
Please login to continue.