public function DateTimePlus::canUseIntl

Tests whether the IntlDateFormatter can be used.

Parameters

string $calendar: (optional) String calendar name to use for the date. Defaults to NULL.

string $langcode: (optional) String two letter language code to construct the locale string by the intlDateFormatter class. Defaults to NULL.

string $country: (optional) String two letter country code to construct the locale string by the intlDateFormatter class. Defaults to NULL.

Return value

bool TRUE if IntlDateFormatter can be used.

2 calls to DateTimePlus::canUseIntl()
DateTimePlus::format in drupal/core/lib/Drupal/Component/Datetime/DateTimePlus.php
Formats the date for display.
DrupalDateTime::format in drupal/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
Overrides format().

File

drupal/core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 653
Definition of Drupal\Component\Datetime\DateTimePlus

Class

DateTimePlus
Extends DateTime().

Namespace

Drupal\Component\Datetime

Code

public function canUseIntl($calendar = NULL, $langcode = NULL, $country = NULL) {
  $langcode = !empty($langcode) ? $langcode : $this->langcode;
  $country = !empty($country) ? $country : $this->country;
  $calendar = !empty($calendar) ? $calendar : $this->calendar;
  return class_exists('IntlDateFormatter') && !empty($calendar) && !empty($langcode) && !empty($country);
}