You are here

public static function PersianDateHelper::ampm in Persian Date for Drupal 8 8.4

Same name and namespace in other branches
  1. 8 src/PersianDateHelper.php \Drupal\persian_date\PersianDateHelper::ampm()

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.

Overrides DateHelper::ampm

File

src/PersianDateHelper.php, line 421

Class

PersianDateHelper

Namespace

Drupal\persian_date

Code

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