From 949e7fe6119fd4c546dc446ab1fd5f592a90680c Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Fri, 30 May 2014 10:59:48 +0100
Subject: [PATCH] Issue #2276183 by alexpott: Fixed Date intl support is
 broken, remove it.

---
 core/config/schema/core.data_types.schema.yml |   2 +-
 core/includes/common.inc                      |  24 ---
 .../Component/Datetime/DateTimePlus.php       | 174 +-----------------
 core/lib/Drupal/Core/Datetime/Date.php        |   8 +-
 .../Drupal/Core/Datetime/DrupalDateTime.php   |  91 ++-------
 .../src/FormElement/DateFormat.php            |   7 +-
 .../src/Tests/ConfigTranslationUiTest.php     |   4 +-
 core/modules/datetime/datetime.module         |  32 ++--
 .../FieldWidget/DateTimeDefaultWidget.php     |   8 +-
 .../datetime/src/Tests/DateTimeFieldTest.php  |  10 +-
 .../src/Tests/LocaleConfigTranslationTest.php |   2 +-
 .../migrate/destination/EntityDateFormat.php  |   2 +-
 .../src/Tests/d6/MigrateDateFormatTest.php    |   8 +-
 .../install/system.date_format.fallback.yml   |   4 +-
 .../install/system.date_format.html_date.yml  |   4 +-
 .../system.date_format.html_datetime.yml      |   4 +-
 .../install/system.date_format.html_month.yml |   4 +-
 .../install/system.date_format.html_time.yml  |   4 +-
 .../install/system.date_format.html_week.yml  |   4 +-
 .../install/system.date_format.html_year.yml  |   4 +-
 .../system.date_format.html_yearless_date.yml |   4 +-
 .../install/system.date_format.long.yml       |   4 +-
 .../install/system.date_format.medium.yml     |   4 +-
 .../install/system.date_format.short.yml      |   4 +-
 .../system/config/schema/system.schema.yml    |  11 +-
 .../system/src/DateFormatInterface.php        |   9 +-
 core/modules/system/src/Entity/DateFormat.php |   8 +-
 .../system/src/Form/DateFormatEditForm.php    |   2 +-
 .../system/src/Form/DateFormatFormBase.php    |  18 +-
 .../Tests/Datetime/DateTimePlusIntlTest.php   |  90 ---------
 .../Tests/Datetime/DrupalDateTimeIntlTest.php |  71 -------
 .../system/src/Tests/System/DateTimeTest.php  |   2 +-
 .../install/system.date_format.fancy.yml      |   4 +-
 33 files changed, 82 insertions(+), 549 deletions(-)
 delete mode 100644 core/modules/system/src/Tests/Datetime/DateTimePlusIntlTest.php
 delete mode 100644 core/modules/system/src/Tests/Datetime/DrupalDateTimeIntlTest.php

diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml
index 827fe9244f8a..ad8b9a83db0d 100644
--- a/core/config/schema/core.data_types.schema.yml
+++ b/core/config/schema/core.data_types.schema.yml
@@ -68,7 +68,7 @@ text:
 # PHP Date format string that is translatable.
 date_format:
   type: string
-  label: 'PHP date format'
+  label: 'Date format'
   translatable: true
 
 # HTML color value.
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 349449a2040a..252baca0d301 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -708,30 +708,6 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
   return $cache[$langcode][$code][$string];
 }
 
-/**
- * Retrieves the correct datetime format type for this system.
- *
- * This value is sometimes required when the format type needs to be determined
- * before a date can be created.
- *
- * @return string
- *   A string as defined in \DrupalComponent\Datetime\DateTimePlus.php: either
- *   'intl' or 'php', depending on whether IntlDateFormatter is available.
- */
-function datetime_default_format_type() {
-  static $drupal_static_fast;
-  if (!isset($drupal_static_fast)) {
-    $drupal_static_fast['format_type'] = &drupal_static(__FUNCTION__);
-  }
-  $format_type = &$drupal_static_fast['format_type'];
-
-  if (!isset($format_type)) {
-    $date = new DrupalDateTime();
-    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-  }
-  return $format_type;
-}
-
 /**
  * @} End of "defgroup format".
  */
diff --git a/core/lib/Drupal/Component/Datetime/DateTimePlus.php b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
index 44e1f5b1da32..4c4122c4c65d 100644
--- a/core/lib/Drupal/Component/Datetime/DateTimePlus.php
+++ b/core/lib/Drupal/Component/Datetime/DateTimePlus.php
@@ -15,16 +15,6 @@
  * format, or an array of date parts. It also adds an errors array
  * and a __toString() method to the date object.
  *
- * In addition, it swaps the IntlDateFormatter into the format() method,
- * if it is available. The format() method is also extended with a settings
- * array to provide settings needed by the IntlDateFormatter. It will
- * will only be used if the class is available, a langcode, country, and
- * calendar have been set, and the format is in the right pattern, otherwise
- * the parent format() method is used in the usual way. These values can
- * either be set globally in the object and reused over and over as the date
- * is repeatedly formatted, or set specifically in the format() method
- * for the requested format.
- *
  * This class is less lenient than the parent DateTime class. It changes
  * the default behavior for handling date values like '2011-00-00'.
  * The parent class would convert that value to '2010-11-30' and report
@@ -39,9 +29,6 @@
 class DateTimePlus extends \DateTime {
 
   const FORMAT   = 'Y-m-d H:i:s';
-  const CALENDAR = 'gregorian';
-  const PHP      = 'php';
-  const INTL     = 'intl';
 
   /**
    * An array of possible date parts.
@@ -90,26 +77,11 @@ class DateTimePlus extends \DateTime {
    */
   protected $langcode = NULL;
 
-  /**
-   * The value of the country code passed to the constructor.
-   */
-  protected $country = NULL;
-
-  /**
-   * The value of the calendar setting passed to the constructor.
-   */
-  protected $calendar = NULL;
-
   /**
    * An array of errors encountered when creating this date.
    */
   protected $errors = array();
 
-  /**
-   * A boolean to store whether or not the intl php extension is available.
-   */
-  static $intlExtentionExists = NULL;
-
   /**
    * Creates a date object from an input date object.
    *
@@ -205,38 +177,7 @@ public static function createFromFormat($format, $time, $timezone = NULL, $setti
     // invalid it doesn't return an exception.
     $datetimeplus = new static('', $timezone, $settings);
 
-    $format_string_type = isset($settings['format_string_type']) ? $settings['format_string_type'] : static::PHP;
-    if ($datetimeplus->canUseIntl() && $format_string_type == static::INTL) {
-      // Construct the $locale variable needed by the IntlDateFormatter.
-      $locale = $datetimeplus->langcode . '_' . $datetimeplus->country;
-
-      // If we have information about a calendar, add it.
-      if (!empty($datetimeplus->calendar) && $datetimeplus->calendar != static::CALENDAR) {
-        $locale .= '@calendar=' . $datetimeplus->calendar;
-      }
-
-      // If we're working with a non-gregorian calendar, indicate that.
-      $calendar_type = \IntlDateFormatter::GREGORIAN;
-      if ($datetimeplus->calendar != static::CALENDAR) {
-        $calendar_type = \IntlDateFormatter::TRADITIONAL;
-      }
-
-      $date_type = !empty($settings['date_type']) ? $settings['date_type'] : \IntlDateFormatter::FULL;
-      $time_type = !empty($settings['time_type']) ? $settings['time_type'] : \IntlDateFormatter::FULL;
-      $timezone = !empty($settings['timezone']) ? $settings['timezone'] : $datetimeplus->getTimezone()->getName();
-      $formatter = new \IntlDateFormatter($locale, $date_type, $time_type, $timezone, $calendar_type, $format);
-
-      $timestamp = $formatter->parse($time);
-      if ($timestamp) {
-        $date = $datetimeplus->createFromTimestamp($timestamp, $timezone, $settings);
-      }
-      else {
-        $date = NULL;
-      }
-    }
-    else {
-      $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
-    }
+    $date = \DateTime::createFromFormat($format, $time, $datetimeplus->getTimezone());
     if (!$date instanceOf \DateTime) {
       throw new \Exception('The date cannot be created from a format.');
     }
@@ -271,16 +212,8 @@ public static function createFromFormat($format, $time, $timezone = NULL, $setti
    *   PHP DateTimeZone object, string or NULL allowed.
    *   Defaults to NULL.
    * @param array $settings
-   *   - langcode: (optional) String two letter language code to construct
-   *     the locale string by the intlDateFormatter class. Used to control
-   *     the result of the format() method if that class is available.
-   *     Defaults to NULL.
-   *   - country: (optional) String two letter country code to construct
-   *     the locale string by the intlDateFormatter class. Used to control
-   *     the result of the format() method if that class is available.
-   *     Defaults to NULL.
-   *   - calendar: (optional) String calendar name to use for the date.
-   *     Defaults to DateTimePlus::CALENDAR.
+   *   - langcode: (optional) String two letter language code used to control
+   *     the result of the format(). Defaults to NULL.
    *   - debug: (optional) Boolean choice to leave debug values in the
    *     date object for debugging purposes. Defaults to FALSE.
    */
@@ -288,8 +221,6 @@ public function __construct($time = 'now', $timezone = NULL, $settings = array()
 
     // Unpack settings.
     $this->langcode = !empty($settings['langcode']) ? $settings['langcode'] : NULL;
-    $this->country = !empty($settings['country']) ? $settings['country'] : NULL;
-    $this->calendar = !empty($settings['calendar']) ? $settings['calendar'] : static::CALENDAR;
 
     // Massage the input values as necessary.
     $prepared_time = $this->prepareTime($time);
@@ -571,71 +502,16 @@ public static function datePad($value, $size = 2) {
     return sprintf("%0" . $size . "d", $value);
   }
 
-
-  /**
-   * Tests whether the IntlDateFormatter can be used.
-   *
-   * @param string $calendar
-   *   (optional) String calendar name to use for the date. Defaults to NULL.
-   * @param string $langcode
-   *   (optional) String two letter language code to construct the locale string
-   *   by the intlDateFormatter class. Defaults to NULL.
-   * @param string $country
-   *   (optional) String two letter country code to construct the locale string
-   *   by the intlDateFormatter class. Defaults to NULL.
-   *
-   * @return bool
-   *   TRUE if IntlDateFormatter can be used.
-   */
-  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 $this->intlDateFormatterExists() && !empty($calendar) && !empty($langcode) && !empty($country);
-  }
-
-  public static function intlDateFormatterExists() {
-    if (static::$intlExtentionExists === NULL) {
-      static::$intlExtentionExists = class_exists('IntlDateFormatter');
-    }
-    return static::$intlExtentionExists;
-  }
-
   /**
    * Formats the date for display.
    *
-   * Uses the IntlDateFormatter to display the format, if possible.
-   * Adds an optional array of settings that provides the information
-   * the IntlDateFormatter will need.
-   *
    * @param string $format
-   *   A format string using either PHP's date() or the
-   *   IntlDateFormatter() format.
+   *   A format string using either PHP's date().
    * @param array $settings
-   *   - format_string_type: (optional) DateTimePlus::PHP or
-   *     DateTimePlus::INTL. Identifies the pattern used by the format
-   *     string. When using the Intl formatter, the format string must
-   *     use the Intl pattern, which is different from the pattern used
-   *     by the DateTime format function. Defaults to DateTimePlus::PHP.
+   *   - langcode: (optional) String two letter language code used to control
+   *     the result of the format(). Defaults to NULL.
    *   - timezone: (optional) String timezone name. Defaults to the timezone
    *     of the date object.
-   *   - langcode: (optional) String two letter language code to construct the
-   *     locale string by the intlDateFormatter class. Used to control the
-   *     result of the format() method if that class is available. Defaults
-   *     to NULL.
-   *   - country: (optional) String two letter country code to construct the
-   *     locale string by the intlDateFormatter class. Used to control the
-   *     result of the format() method if that class is available. Defaults
-   *     to NULL.
-   *   - calendar: (optional) String calendar name to use for the date,
-   *     Defaults to DateTimePlus::CALENDAR.
-   *   - date_type: (optional) Integer date type to use in the formatter,
-   *     defaults to IntlDateFormatter::FULL.
-   *   - time_type: (optional) Integer date type to use in the formatter,
-   *     defaults to IntlDateFormatter::FULL.
-   *   - lenient: (optional) Boolean choice of whether or not to use lenient
-   *     processing in the intl formatter. Defaults to FALSE;
    *
    * @return string
    *   The formatted value of the date.
@@ -647,45 +523,9 @@ public function format($format, $settings = array()) {
       return;
     }
 
-    $format_string_type = isset($settings['format_string_type']) ? $settings['format_string_type'] : static::PHP;
-    $langcode = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode;
-    $country = !empty($settings['country']) ? $settings['country'] : $this->country;
-    $calendar = !empty($settings['calendar']) ? $settings['calendar'] : $this->calendar;
-
     // Format the date and catch errors.
     try {
-
-      // If we have what we need to use the IntlDateFormatter, do so.
-      if ($this->canUseIntl($calendar, $langcode, $country) && $format_string_type == static::INTL) {
-
-        // Construct the $locale variable needed by the IntlDateFormatter.
-        $locale = $langcode . '_' . $country;
-
-        // If we have information about a calendar, add it.
-        if (!empty($calendar) && $calendar != static::CALENDAR) {
-          $locale .= '@calendar=' . $calendar;
-        }
-
-        // If we're working with a non-gregorian calendar, indicate that.
-        $calendar_type = \IntlDateFormatter::GREGORIAN;
-        if ($calendar != self::CALENDAR) {
-          $calendar_type = \IntlDateFormatter::TRADITIONAL;
-        }
-
-        $date_type = !empty($settings['date_type']) ? $settings['date_type'] : \IntlDateFormatter::FULL;
-        $time_type = !empty($settings['time_type']) ? $settings['time_type'] : \IntlDateFormatter::FULL;
-        $timezone = !empty($settings['timezone']) ? $settings['timezone'] : $this->getTimezone()->getName();
-        $formatter = new \IntlDateFormatter($locale, $date_type, $time_type, $timezone, $calendar_type, $format);
-
-        $lenient = !empty($settings['lenient']) ? $settings['lenient'] : FALSE;
-        $formatter->setLenient($lenient);
-        $value = $formatter->format($this);
-      }
-
-      // Otherwise, use the parent method.
-      else {
-        $value = parent::format($format);
-      }
+      $value = parent::format($format);
     }
     catch (\Exception $e) {
       $this->errors[] = $e->getMessage();
diff --git a/core/lib/Drupal/Core/Datetime/Date.php b/core/lib/Drupal/Core/Datetime/Date.php
index 2dd512a58ee8..2a31eb7b904c 100644
--- a/core/lib/Drupal/Core/Datetime/Date.php
+++ b/core/lib/Drupal/Core/Datetime/Date.php
@@ -142,23 +142,19 @@ public function format($timestamp, $type = 'medium', $format = '', $timezone = N
     );
     $date = DrupalDateTime::createFromTimestamp($timestamp, $this->timezones[$timezone], $create_settings);
 
-    // Find the appropriate format type.
-    $key = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-
     // If we have a non-custom date format use the provided date format pattern.
     if ($date_format = $this->dateFormat($type, $langcode)) {
-      $format = $date_format->getPattern($key);
+      $format = $date_format->getPattern();
     }
 
     // Fall back to medium if a format was not found.
     if (empty($format)) {
-      $format = $this->dateFormat('fallback', $langcode)->getPattern($key);
+      $format = $this->dateFormat('fallback', $langcode)->getPattern();
     }
 
     // Call $date->format().
     $settings = array(
       'langcode' => $langcode,
-      'format_string_type' => $key,
     );
     return Xss::filter($date->format($format, $settings));
   }
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
index 2d4be4614daf..18b0f9d1ed5a 100644
--- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
@@ -37,29 +37,16 @@ class DrupalDateTime extends DateTimePlus {
    *     possible to a validation step to confirm that the date created
    *     from a format string exactly matches the input. This option
    *     indicates the format can be used for validation. Defaults to TRUE.
-   *   - langcode: (optional) String two letter language code to construct
-   *     the locale string by the intlDateFormatter class. Used to control
-   *     the result of the format() method if that class is available.
+   *   - langcode: (optional) Used to control the result of the format() method.
    *     Defaults to NULL.
-   *   - country: (optional) String two letter country code to construct
-   *     the locale string by the intlDateFormatter class. Used to control
-   *     the result of the format() method if that class is available.
-   *     Defaults to NULL.
-   *   - calendar: (optional) String calendar name to use for the date.
-   *     Defaults to DateTimePlus::CALENDAR.
    *   - debug: (optional) Boolean choice to leave debug values in the
    *     date object for debugging purposes. Defaults to FALSE.
    */
   public function __construct($time = 'now', $timezone = NULL, $settings = array()) {
-    // We can set the langcode and country using Drupal values.
     if (!isset($settings['langcode'])) {
       $settings['langcode'] = \Drupal::languageManager()->getCurrentLanguage()->id;
     }
 
-    if (!isset($settings['country'])) {
-      $settings['country'] = \Drupal::config('system.date')->get('country.default');
-    }
-
     // Instantiate the parent class.
     parent::__construct($time, $timezone, $settings);
 
@@ -82,75 +69,37 @@ protected function prepareTimezone($timezone) {
   /**
    * Overrides format().
    *
-   * Uses the IntlDateFormatter to display the format, if possible.
-   * Adds an optional array of settings that provides the information
-   * the IntlDateFormatter will need.
-   *
    * @param string $format
-   *   A format string using either PHP's date() or the
-   *   IntlDateFormatter() format.
+   *   A format string using either PHP's date().
    * @param array $settings
-   *   - format_string_type: (optional) DateTimePlus::PHP or
-   *     DateTimePlus::INTL. Identifies the pattern used by the format
-   *     string. When using the Intl formatter, the format string must
-   *     use the Intl pattern, which is different from the pattern used
-   *     by the DateTime format function. Defaults to DateTimePlus::PHP.
    *   - timezone: (optional) String timezone name. Defaults to the timezone
    *     of the date object.
-   *   - langcode: (optional) String two letter language code to construct the
-   *     locale string by the intlDateFormatter class. Used to control the
-   *     result of the format() method if that class is available. Defaults
-   *     to NULL.
-   *   - country: (optional) String two letter country code to construct the
-   *     locale string by the intlDateFormatter class. Used to control the
-   *     result of the format() method if that class is available. Defaults
-   *     to NULL.
-   *   - calendar: (optional) String calendar name to use for the date,
-   *     Defaults to DateTimePlus::CALENDAR.
-   *   - date_type: (optional) Integer date type to use in the formatter,
-   *     defaults to IntlDateFormatter::FULL.
-   *   - time_type: (optional) Integer date type to use in the formatter,
-   *     defaults to IntlDateFormatter::FULL.
-   *   - lenient: (optional) Boolean choice of whether or not to use lenient
-   *     processing in the intl formatter. Defaults to FALSE;
+   *   - langcode: (optional) String two letter language code used to control
+   *     the result of the format() method. Defaults to NULL.
    *
    * @return string
    *   The formatted value of the date.
    */
   public function format($format, $settings = array()) {
-
-    $settings['format_string_type'] = isset($settings['format_string_type']) ? $settings['format_string_type'] : static::PHP;
-    $settings['calendar'] = !empty($settings['calendar']) ? $settings['calendar'] : $this->calendar;
     $settings['langcode'] = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode;
-    $settings['country'] = !empty($settings['country']) ? $settings['country'] : $this->country;
     // Format the date and catch errors.
     try {
-
-      // If we have what we need to use the IntlDateFormatter, do so.
-      if ($this->canUseIntl($settings['calendar'], $settings['langcode'], $settings['country']) && $settings['format_string_type'] == parent::INTL) {
-        $value = parent::format($format, $settings);
-      }
-
-      // Otherwise, use the default Drupal method.
-      else {
-
-        // Encode markers that should be translated. 'A' becomes
-        // '\xEF\AA\xFF'. xEF and xFF are invalid UTF-8 sequences,
-        // and we assume they are not in the input string.
-        // Paired backslashes are isolated to prevent errors in
-        // read-ahead evaluation. The read-ahead expression ensures that
-        // A matches, but not \A.
-        $format = preg_replace(array('/\\\\\\\\/', '/(?<!\\\\)([AaeDlMTF])/'), array("\xEF\\\\\\\\\xFF", "\xEF\\\\\$1\$1\xFF"), $format);
-
-        // Call date_format().
-        $format = parent::format($format);
-
-        // Pass the langcode to _format_date_callback().
-        _format_date_callback(NULL, $settings['langcode']);
-
-        // Translate the marked sequences.
-        $value = preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
-      }
+      // Encode markers that should be translated. 'A' becomes
+      // '\xEF\AA\xFF'. xEF and xFF are invalid UTF-8 sequences,
+      // and we assume they are not in the input string.
+      // Paired backslashes are isolated to prevent errors in
+      // read-ahead evaluation. The read-ahead expression ensures that
+      // A matches, but not \A.
+      $format = preg_replace(array('/\\\\\\\\/', '/(?<!\\\\)([AaeDlMTF])/'), array("\xEF\\\\\\\\\xFF", "\xEF\\\\\$1\$1\xFF"), $format);
+
+      // Call date_format().
+      $format = parent::format($format);
+
+      // Pass the langcode to _format_date_callback().
+      _format_date_callback(NULL, $settings['langcode']);
+
+      // Translate the marked sequences.
+      $value = preg_replace_callback('/\xEF([AaeDlMTF]?)(.*?)\xFF/', '_format_date_callback', $format);
     }
     catch (\Exception $e) {
       $this->errors[] = $e->getMessage();
diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php
index 3abb57eca225..762968ba0900 100644
--- a/core/modules/config_translation/src/FormElement/DateFormat.php
+++ b/core/modules/config_translation/src/FormElement/DateFormat.php
@@ -23,12 +23,7 @@ class DateFormat implements ElementInterface {
    * {@inheritdoc}
    */
   public function getFormElement(array $definition, Language $language, $value) {
-    if (class_exists('intlDateFormatter')) {
-      $description = $this->t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://userguide.icu-project.org/formatparse/datetime'));
-    }
-    else {
-      $description = $this->t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php'));
-    }
+    $description = $this->t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php'));
     $format = $this->t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $value)));
     return array(
       '#type' => 'textfield',
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
index 46ef47f1259d..b01feb8b3cff 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
@@ -403,7 +403,7 @@ public function testDateFormatTranslation() {
       // Update translatable fields.
       $edit = array(
         'config_names[system.date_format.' . $id . '][label][translation]' => $id . ' - FR',
-        'config_names[system.date_format.' . $id . '][pattern][pattern.php][translation]' => 'D',
+        'config_names[system.date_format.' . $id . '][pattern][translation]' => 'D',
       );
 
       // Save language specific version of form.
@@ -413,7 +413,7 @@ public function testDateFormatTranslation() {
       $override = \Drupal::languageManager()->getLanguageConfigOverride('fr', 'system.date_format.' . $id);
       $expected = array(
         'label' => $id . ' - FR',
-        'pattern' => array('php' => 'D'),
+        'pattern' => 'D',
       );
       $this->assertEqual($expected, $override->get());
 
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index 3d13b7b7655a..b9fecdb9b236 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -30,17 +30,15 @@
  * Implements hook_element_info().
  */
 function datetime_element_info() {
-  $format_type = datetime_default_format_type();
-
   $date_format = '';
   $time_format = '';
   // Date formats cannot be loaded during install or update.
   if (!defined('MAINTENANCE_MODE')) {
     if ($date_format_entity = entity_load('date_format', 'html_date')) {
-      $date_format = $date_format_entity->getPattern($format_type);
+      $date_format = $date_format_entity->getPattern();
     }
     if ($time_format_entity = entity_load('date_format', 'html_time')) {
-      $time_format = $time_format_entity->getPattern($format_type);
+      $time_format = $time_format_entity->getPattern();
     }
   }
   $types['datetime'] = array(
@@ -51,7 +49,6 @@ function datetime_element_info() {
     '#theme' => 'datetime_form',
     '#theme_wrappers' => array('datetime_wrapper'),
     '#date_date_format' => $date_format,
-    '#date_format_string_type' => $format_type,
     '#date_date_element' => 'date',
     '#date_date_callbacks' => array(),
     '#date_time_format' => $time_format,
@@ -341,7 +338,7 @@ function template_preprocess_datetime_wrapper(&$variables) {
  *   The form element whose value has been processed.
  */
 function datetime_datetime_form_process($element, &$form_state) {
-  $format_settings = array('format_string_type' => $element['#date_format_string_type']);
+  $format_settings = array();
   // The value callback has populated the #value array.
   $date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
 
@@ -468,8 +465,7 @@ function form_type_datetime_value($element, $input = FALSE) {
     try {
       $date_time_format = trim($date_format . ' ' . $time_format);
       $date_time_input = trim($date_input . ' ' . $time_input);
-      $date_time_settings = array('format_string_type' => $element['#date_format_string_type']);
-      $date = DrupalDateTime::createFromFormat($date_time_format, $date_time_input, $timezone, $date_time_settings);
+      $date = DrupalDateTime::createFromFormat($date_time_format, $date_time_input, $timezone);
     }
     catch (\Exception $e) {
       $date = NULL;
@@ -484,8 +480,8 @@ function form_type_datetime_value($element, $input = FALSE) {
     $date = $element['#default_value'];
     if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
       $input = array(
-        'date'   => $date->format($element['#date_date_format'], array('format_string_type' => $element['#date_format_string_type'])),
-        'time'   => $date->format($element['#date_time_format'], array('format_string_type' => $element['#date_format_string_type'])),
+        'date'   => $date->format($element['#date_date_format']),
+        'time'   => $date->format($element['#date_time_format']),
         'object' => $date,
       );
     }
@@ -564,16 +560,15 @@ function datetime_datetime_validate($element, &$form_state) {
  *   if this is not a HTML5 element.
  */
 function datetime_html5_format($part, $element) {
-  $format_type = datetime_default_format_type();
   switch ($part) {
     case 'date':
       switch ($element['#date_date_element']) {
         case 'date':
-          return entity_load('date_format', 'html_date')->getPattern($format_type);
+          return entity_load('date_format', 'html_date')->getPattern();
 
         case 'datetime':
         case 'datetime-local':
-          return entity_load('date_format', 'html_datetime')->getPattern($format_type);
+          return entity_load('date_format', 'html_datetime')->getPattern();
 
         default:
           return $element['#date_date_format'];
@@ -583,7 +578,7 @@ function datetime_html5_format($part, $element) {
     case 'time':
       switch ($element['#date_time_element']) {
         case 'time':
-          return entity_load('date_format', 'html_time')->getPattern($format_type);
+          return entity_load('date_format', 'html_time')->getPattern();
 
         default:
           return $element['#date_time_format'];
@@ -604,12 +599,11 @@ function datetime_html5_format($part, $element) {
  *
  */
 function datetime_format_example($format) {
-  $format_type = datetime_default_format_type();
   $date = &drupal_static(__FUNCTION__);
   if (empty($date)) {
     $date = new DrupalDateTime();
   }
-  return $date->format($format, array('format_string_type' => $format_type));
+  return $date->format($format);
 }
 
 /**
@@ -987,12 +981,10 @@ function datetime_range_years($string, $date = NULL) {
  * Implements hook_form_BASE_FORM_ID_alter() for node forms.
  */
 function datetime_form_node_form_alter(&$form, &$form_state, $form_id) {
-  $format_type = datetime_default_format_type();
-
   // Alter the 'Authored on' date to use datetime.
   $form['created']['#type'] = 'datetime';
-  $date_format = entity_load('date_format', 'html_date')->getPattern($format_type);
-  $time_format = entity_load('date_format', 'html_time')->getPattern($format_type);
+  $date_format = entity_load('date_format', 'html_date')->getPattern();
+  $time_format = entity_load('date_format', 'html_time')->getPattern();
   $form['created']['#description'] = t('Format: %format. Leave blank to use the time of form submission.', array('%format' => datetime_format_example($date_format . ' ' . $time_format)));
   unset($form['created']['#maxlength']);
 }
diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
index ca60f4a1bd2c..161bada4d6de 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
@@ -45,8 +45,6 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter
    * {@inheritdoc}
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
-    $format_type = datetime_default_format_type();
-
     // We are nesting some sub-elements inside the parent, so we need a wrapper.
     // We also need to add another #title attribute at the top level for ease in
     // identifying this item in error messages. We do not want to display this
@@ -62,7 +60,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
       case DateTimeItem::DATETIME_TYPE_DATE:
         $date_type = 'date';
         $time_type = 'none';
-        $date_format = $this->dateStorage->load('html_date')->getPattern($format_type);
+        $date_format = $this->dateStorage->load('html_date')->getPattern();
         $time_format = '';
         $element_format = $date_format;
         $storage_format = DATETIME_DATE_STORAGE_FORMAT;
@@ -71,8 +69,8 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
       default:
         $date_type = 'date';
         $time_type = 'time';
-        $date_format = $this->dateStorage->load('html_date')->getPattern($format_type);
-        $time_format = $this->dateStorage->load('html_time')->getPattern($format_type);
+        $date_format = $this->dateStorage->load('html_date')->getPattern();
+        $time_format = $this->dateStorage->load('html_time')->getPattern();
         $element_format = $date_format . ' ' . $time_format;
         $storage_format = DATETIME_DATETIME_STORAGE_FORMAT;
         break;
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index a83250c6c1d3..0b5caf0d7626 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -104,9 +104,8 @@ function testDateField() {
     // Submit a valid date and ensure it is accepted.
     $value = '2012-12-31 00:00:00';
     $date = new DrupalDateTime($value);
-    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-    $date_format = entity_load('date_format', 'html_date')->getPattern($format_type);
-    $time_format = entity_load('date_format', 'html_time')->getPattern($format_type);
+    $date_format = entity_load('date_format', 'html_date')->getPattern();
+    $time_format = entity_load('date_format', 'html_time')->getPattern();
 
     $edit = array(
       'user_id' => 1,
@@ -174,9 +173,8 @@ function testDatetimeField() {
     // Submit a valid date and ensure it is accepted.
     $value = '2012-12-31 00:00:00';
     $date = new DrupalDateTime($value);
-    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-    $date_format = entity_load('date_format', 'html_date')->getPattern($format_type);
-    $time_format = entity_load('date_format', 'html_time')->getPattern($format_type);
+    $date_format = entity_load('date_format', 'html_date')->getPattern();
+    $time_format = entity_load('date_format', 'html_time')->getPattern();
 
     $edit = array(
       'user_id' => 1,
diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
index a4ee53a70397..a638bd501bcf 100644
--- a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
@@ -117,7 +117,7 @@ function testConfigTranslation() {
 
     // Get translation and check we've only got the site name.
     $translation = $wrapper->getTranslation($langcode);
-    $format = $translation->get('pattern')->get('php')->getValue();
+    $format = $translation->get('pattern')->getValue();
     $this->assertEqual($format, 'D', 'Got the right date format pattern after translation.');
 
     // Formatting the date 8 / 27 / 1985 @ 13:37 EST with pattern D should
diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityDateFormat.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityDateFormat.php
index 5124ab096030..695056aa9243 100644
--- a/core/modules/migrate/src/Plugin/migrate/destination/EntityDateFormat.php
+++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityDateFormat.php
@@ -24,7 +24,7 @@ class EntityDateFormat extends EntityConfigBase {
    */
   protected function updateEntityProperty(EntityInterface $entity, array $parents, $value) {
     if ($parents[0] == 'pattern') {
-      $entity->setPattern($value, $parents[1]);
+      $entity->setPattern($value);
     }
     else {
       parent::updateEntityProperty($entity, $parents, $value);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
index a79df39a234d..c334d9407500 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
@@ -44,13 +44,13 @@ public function setUp() {
    */
   public function testDateFormats() {
     $short_date_format = entity_load('date_format', 'short');
-    $this->assertEqual('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern(DrupalDateTime::PHP));
+    $this->assertEqual('\S\H\O\R\T m/d/Y - H:i', $short_date_format->getPattern());
 
     $medium_date_format = entity_load('date_format', 'medium');
-    $this->assertEqual('\M\E\D\I\U\M D, m/d/Y - H:i', $medium_date_format->getPattern(DrupalDateTime::PHP));
+    $this->assertEqual('\M\E\D\I\U\M D, m/d/Y - H:i', $medium_date_format->getPattern());
 
     $long_date_format = entity_load('date_format', 'long');
-    $this->assertEqual('\L\O\N\G l, F j, Y - H:i', $long_date_format->getPattern(DrupalDateTime::PHP));
+    $this->assertEqual('\L\O\N\G l, F j, Y - H:i', $long_date_format->getPattern());
 
     // Test that we can re-import using the EntityDateFormat destination.
     Database::getConnection('default', 'migrate')
@@ -64,7 +64,7 @@ public function testDateFormats() {
     $executable->import();
 
     $short_date_format = entity_load('date_format', 'short');
-    $this->assertEqual('\S\H\O\R\T d/m/Y - H:i', $short_date_format->getPattern(DrupalDateTime::PHP));
+    $this->assertEqual('\S\H\O\R\T d/m/Y - H:i', $short_date_format->getPattern());
 
   }
 
diff --git a/core/modules/system/config/install/system.date_format.fallback.yml b/core/modules/system/config/install/system.date_format.fallback.yml
index 86e6927192df..6e5c9dc22bac 100644
--- a/core/modules/system/config/install/system.date_format.fallback.yml
+++ b/core/modules/system/config/install/system.date_format.fallback.yml
@@ -3,6 +3,4 @@ label: 'Fallback date format'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: 'D, m/d/Y - H:i'
-  intl: 'ccc, MM/dd/yyyy - kk:mm'
+pattern: 'D, m/d/Y - H:i'
diff --git a/core/modules/system/config/install/system.date_format.html_date.yml b/core/modules/system/config/install/system.date_format.html_date.yml
index 5d16688c65e8..c489b83fa2b1 100644
--- a/core/modules/system/config/install/system.date_format.html_date.yml
+++ b/core/modules/system/config/install/system.date_format.html_date.yml
@@ -3,6 +3,4 @@ label: 'HTML Date'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: Y-m-d
-  intl: yyyy-MM-dd
+pattern: Y-m-d
diff --git a/core/modules/system/config/install/system.date_format.html_datetime.yml b/core/modules/system/config/install/system.date_format.html_datetime.yml
index 08bd0a749a0e..32debaefc67b 100644
--- a/core/modules/system/config/install/system.date_format.html_datetime.yml
+++ b/core/modules/system/config/install/system.date_format.html_datetime.yml
@@ -3,6 +3,4 @@ label: 'HTML Datetime'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: 'Y-m-d\TH:i:sO'
-  intl: 'yyyy-MM-dd''T''kk:mm:ssZZ'
+pattern: 'Y-m-d\TH:i:sO'
diff --git a/core/modules/system/config/install/system.date_format.html_month.yml b/core/modules/system/config/install/system.date_format.html_month.yml
index 95f5bb67596f..a3703206e553 100644
--- a/core/modules/system/config/install/system.date_format.html_month.yml
+++ b/core/modules/system/config/install/system.date_format.html_month.yml
@@ -3,6 +3,4 @@ label: 'HTML Month'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: Y-m
-  intl: Y-MM
+pattern: Y-m
diff --git a/core/modules/system/config/install/system.date_format.html_time.yml b/core/modules/system/config/install/system.date_format.html_time.yml
index 493dc3907a24..0c45877c21ce 100644
--- a/core/modules/system/config/install/system.date_format.html_time.yml
+++ b/core/modules/system/config/install/system.date_format.html_time.yml
@@ -3,6 +3,4 @@ label: 'HTML Time'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: 'H:i:s'
-  intl: 'H:mm:ss'
+pattern: 'H:i:s'
diff --git a/core/modules/system/config/install/system.date_format.html_week.yml b/core/modules/system/config/install/system.date_format.html_week.yml
index 0cb16220d0b6..bb5dc6e9cdd9 100644
--- a/core/modules/system/config/install/system.date_format.html_week.yml
+++ b/core/modules/system/config/install/system.date_format.html_week.yml
@@ -3,6 +3,4 @@ label: 'HTML Week'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: Y-\WW
-  intl: 'Y-''W''WW'
+pattern: Y-\WW
diff --git a/core/modules/system/config/install/system.date_format.html_year.yml b/core/modules/system/config/install/system.date_format.html_year.yml
index 23d76721eef2..1a3aadc0b68e 100644
--- a/core/modules/system/config/install/system.date_format.html_year.yml
+++ b/core/modules/system/config/install/system.date_format.html_year.yml
@@ -3,6 +3,4 @@ label: 'HTML Year'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: Y
-  intl: Y
+pattern: Y
diff --git a/core/modules/system/config/install/system.date_format.html_yearless_date.yml b/core/modules/system/config/install/system.date_format.html_yearless_date.yml
index f88b34d463be..a17ef344d5a7 100644
--- a/core/modules/system/config/install/system.date_format.html_yearless_date.yml
+++ b/core/modules/system/config/install/system.date_format.html_yearless_date.yml
@@ -3,6 +3,4 @@ label: 'HTML Yearless date'
 status: true
 langcode: en
 locked: true
-pattern:
-  php: m-d
-  intl: MM-d
+pattern: m-d
diff --git a/core/modules/system/config/install/system.date_format.long.yml b/core/modules/system/config/install/system.date_format.long.yml
index 53359deb5f2f..b8a09e31bfd7 100644
--- a/core/modules/system/config/install/system.date_format.long.yml
+++ b/core/modules/system/config/install/system.date_format.long.yml
@@ -3,6 +3,4 @@ label: 'Default long date'
 status: true
 langcode: en
 locked: false
-pattern:
-  php: 'l, F j, Y - H:i'
-  intl: 'EEEE, LLLL d, yyyy - kk:mm'
+pattern: 'l, F j, Y - H:i'
diff --git a/core/modules/system/config/install/system.date_format.medium.yml b/core/modules/system/config/install/system.date_format.medium.yml
index a5f09f8c5896..59376fdb3d88 100644
--- a/core/modules/system/config/install/system.date_format.medium.yml
+++ b/core/modules/system/config/install/system.date_format.medium.yml
@@ -3,6 +3,4 @@ label: 'Default medium date'
 status: true
 langcode: en
 locked: false
-pattern:
-  php: 'D, m/d/Y - H:i'
-  intl: 'ccc, MM/dd/yyyy - kk:mm'
+pattern: 'D, m/d/Y - H:i'
diff --git a/core/modules/system/config/install/system.date_format.short.yml b/core/modules/system/config/install/system.date_format.short.yml
index 1452af8f8a0c..654fed40499c 100644
--- a/core/modules/system/config/install/system.date_format.short.yml
+++ b/core/modules/system/config/install/system.date_format.short.yml
@@ -3,6 +3,4 @@ label: 'Default short date'
 status: true
 langcode: en
 locked: false
-pattern:
-  php: 'm/d/Y - H:i'
-  intl: 'MM/dd/yyyy - kk:mm'
+pattern: 'm/d/Y - H:i'
diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml
index 690a3ecbd267..ea18c2d51e09 100644
--- a/core/modules/system/config/schema/system.schema.yml
+++ b/core/modules/system/config/schema/system.schema.yml
@@ -134,15 +134,8 @@ system.date_format.*:
       type: boolean
       label: 'Locked'
     pattern:
-      type: mapping
-      label: 'Format string'
-      mapping:
-        php:
-          type: date_format
-          label: 'PHP date format'
-        intl:
-          type: string
-          label: 'Intl date format'
+      type: date_format
+      label: 'PHP date format'
     langcode:
       type: string
       label: 'Default language'
diff --git a/core/modules/system/src/DateFormatInterface.php b/core/modules/system/src/DateFormatInterface.php
index 7a15cb280c03..0d6b34b4862a 100644
--- a/core/modules/system/src/DateFormatInterface.php
+++ b/core/modules/system/src/DateFormatInterface.php
@@ -18,26 +18,21 @@ interface DateFormatInterface extends ConfigEntityInterface {
   /**
    * Gets the date pattern string for this format.
    *
-   * @param string $type
-   *   The date pattern type to set.
-   *
    * @return string
    *   The pattern string as expected by date().
    */
-  public function getPattern($type = DrupalDateTime::PHP);
+  public function getPattern();
 
   /**
    * Sets the date pattern for this format.
    *
    * @param string $pattern
    *   The date pattern to use for this format.
-   * @param string $type
-   *   The date pattern type to set.
    *
    * @return self
    *   Returns the date format.
    */
-  public function setPattern($pattern, $type = DrupalDateTime::PHP);
+  public function setPattern($pattern);
 
   /**
    * Determines if this date format is locked.
diff --git a/core/modules/system/src/Entity/DateFormat.php b/core/modules/system/src/Entity/DateFormat.php
index a3d6ece5f0d4..360c6b55a133 100644
--- a/core/modules/system/src/Entity/DateFormat.php
+++ b/core/modules/system/src/Entity/DateFormat.php
@@ -85,15 +85,15 @@ public function toArray() {
   /**
    * {@inheritdoc}
    */
-  public function getPattern($type = DrupalDateTime::PHP) {
-    return isset($this->pattern[$type]) ? $this->pattern[$type] : '';
+  public function getPattern() {
+    return $this->pattern;
   }
 
   /**
    * {@inheritdoc}
    */
-  public function setPattern($pattern, $type = DrupalDateTime::PHP) {
-    $this->pattern[$type] = $pattern;
+  public function setPattern($pattern) {
+    $this->pattern = $pattern;
     return $this;
   }
 
diff --git a/core/modules/system/src/Form/DateFormatEditForm.php b/core/modules/system/src/Form/DateFormatEditForm.php
index 3b25d7ed9f02..500f5bae7004 100644
--- a/core/modules/system/src/Form/DateFormatEditForm.php
+++ b/core/modules/system/src/Form/DateFormatEditForm.php
@@ -20,7 +20,7 @@ public function form(array $form, array &$form_state) {
 
     $now = t('Displayed as %date', array('%date' => $this->dateService->format(REQUEST_TIME, $this->entity->id())));
     $form['date_format_pattern']['#field_suffix'] = ' <small id="edit-date-format-suffix">' . $now . '</small>';
-    $form['date_format_pattern']['#default_value'] = $this->entity->getPattern($this->patternType);
+    $form['date_format_pattern']['#default_value'] = $this->entity->getPattern();
 
     return $form;
   }
diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php
index 3dfb81ef9082..3bfcb60f0feb 100644
--- a/core/modules/system/src/Form/DateFormatFormBase.php
+++ b/core/modules/system/src/Form/DateFormatFormBase.php
@@ -21,13 +21,6 @@
  */
 abstract class DateFormatFormBase extends EntityForm {
 
-  /**
-   * The date pattern type.
-   *
-   * @var string
-   */
-  protected $patternType;
-
   /**
    * The date service.
    *
@@ -52,7 +45,6 @@ abstract class DateFormatFormBase extends EntityForm {
    */
   public function __construct(Date $date_service, ConfigEntityStorageInterface $date_format_storage) {
     $date = new DrupalDateTime();
-    $this->patternType = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
 
     $this->dateService = $date_service;
     $this->dateFormatStorage = $date_format_storage;
@@ -136,17 +128,11 @@ public function form(array $form, array &$form_state) {
       ),
     );
 
-    if (class_exists('intlDateFormatter')) {
-      $description = t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://userguide.icu-project.org/formatparse/datetime'));
-    }
-    else {
-      $description = t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php'));
-    }
     $form['date_format_pattern'] = array(
       '#type' => 'textfield',
       '#title' => t('Format string'),
       '#maxlength' => 100,
-      '#description' => $description,
+      '#description' => $this->t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php')),
       '#default_value' => '',
       '#field_suffix' => ' <small id="edit-date-format-suffix"></small>',
       '#ajax' => array(
@@ -190,7 +176,7 @@ public function validate(array $form, array &$form_state) {
    */
   public function submit(array $form, array &$form_state) {
     $form_state['redirect_route']['route_name'] = 'system.date_format_list';
-    $form_state['values']['pattern'][$this->patternType] = trim($form_state['values']['date_format_pattern']);
+    $form_state['values']['pattern'] = trim($form_state['values']['date_format_pattern']);
 
     parent::submit($form, $form_state);
     $this->entity->save();
diff --git a/core/modules/system/src/Tests/Datetime/DateTimePlusIntlTest.php b/core/modules/system/src/Tests/Datetime/DateTimePlusIntlTest.php
deleted file mode 100644
index eb21948c23f0..000000000000
--- a/core/modules/system/src/Tests/Datetime/DateTimePlusIntlTest.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Tests\Datetime\DateTimePlusIntlTest.
- */
-
-namespace Drupal\system\Tests\Datetime;
-
-use Drupal\Component\Datetime\DateTimePlus;
-use Drupal\Core\Datetime\DrupalDateTime;
-use Drupal\simpletest\DrupalUnitTestBase;
-
-/**
- * Tests use of PHP's internationalization extension to format dates.
- */
-class DateTimePlusIntlTest extends DrupalUnitTestBase {
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('system');
-
-  public static function getInfo() {
-    return array(
-      'name' => 'DateTimePlusIntl',
-      'description' => 'Test DateTimePlus PECL Intl functionality.',
-      'group' => 'Datetime',
-    );
-  }
-
-  public function setUp() {
-    parent::setUp();
-    // Install default config for system.
-    $this->installConfig(array('system'));
-  }
-
-  /**
-   * Ensures that PHP's Intl extension is installed.
-   *
-   * @return array
-   *   Array of errors containing a list of unmet requirements.
-   */
-  function checkRequirements() {
-    if (!class_exists('IntlDateFormatter')) {
-      return array(
-        'PHP\'s Intl extension needs to be installed and enabled.',
-      );
-    }
-    return parent::checkRequirements();
-  }
-
-  /**
-   * Tests that PHP and Intl default formats are equivalent.
-   */
-  function testDateTimestampIntl() {
-
-    // Create date object from a unix timestamp and display it in local time.
-    $input = '2007-01-31 21:00:00';
-    $timezone = 'UTC';
-    $intl_settings = array(
-      'format_string_type' => DateTimePlus::INTL,
-      'country' => 'US',
-      'langcode' => 'en',
-    );
-    $php_settings = array(
-      'country' => NULL,
-      'langcode' => 'en',
-    );
-
-    $intl_date = new DateTimePlus($input, $timezone, $intl_settings);
-    $php_date = new DateTimePlus($input, $timezone, $php_settings);
-
-    $this->assertTrue($intl_date->canUseIntl(), 'DateTimePlus object can use intl when provided with country and langcode settings.');
-    $this->assertFalse($php_date->canUseIntl(), 'DateTimePlus object will fallback to use PHP when not provided with country setting.');
-
-    $default_formats = $this->container->get('entity.manager')
-      ->getStorage('date_format')
-      ->loadMultiple();
-
-    foreach ($default_formats as $format) {
-      $php_format = $php_date->format($format->getPattern(DrupalDateTime::PHP), $php_settings);
-      $intl_format = $intl_date->format($format->getPattern(DrupalDateTime::INTL), $intl_settings);
-      $this->assertIdentical($intl_format, $php_format);
-    }
-  }
-
-}
diff --git a/core/modules/system/src/Tests/Datetime/DrupalDateTimeIntlTest.php b/core/modules/system/src/Tests/Datetime/DrupalDateTimeIntlTest.php
deleted file mode 100644
index d6dacbd4b9c6..000000000000
--- a/core/modules/system/src/Tests/Datetime/DrupalDateTimeIntlTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Tests\Datetime\DrupalDateTimeIntlTest.
- */
-
-namespace Drupal\system\Tests\Datetime;
-
-use Drupal\Core\Datetime\DrupalDateTime;
-use Drupal\simpletest\DrupalUnitTestBase;
-
-/**
- * Tests use of PHP's internationalization extension to format dates.
- */
-class DrupalDateTimeIntlTest extends DrupalUnitTestBase {
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('system');
-
-  public static function getInfo() {
-    return array(
-      'name' => 'DrupalDateTimeIntl',
-      'description' => 'Test DrupalDateTime Intl functionality.',
-      'group' => 'Datetime',
-    );
-  }
-
-  public function setUp() {
-    parent::setUp();
-    // Install default config for system.
-    $this->installConfig(array('system'));
-  }
-
-  /**
-   * Ensures that PHP's Intl extension is installed.
-   *
-   * @return array
-   *   Array of errors containing a list of unmet requirements.
-   */
-  function checkRequirements() {
-    if (!class_exists('IntlDateFormatter')) {
-      return array(
-        'PHP\'s Intl extension needs to be installed and enabled.',
-      );
-    }
-    return parent::checkRequirements();
-  }
-
-  /**
-   * Tests that PHP and Intl default formats are equivalent.
-   */
-  function testDrupalDateTimeIntl() {
-    $input_value = '2013-09-27 17:40:41';
-    $timezone = drupal_get_user_timezone();
-    $format = 'yyyy-MM-dd HH:mm:ss';
-    $format_settings = array(
-      'country' => 'UA',
-      'langcode' => 'ru',
-      'format_string_type' => DrupalDateTime::INTL
-    );
-    $date = DrupalDateTime::createFromFormat($format, $input_value, $timezone, $format_settings);
-    $output_value = $date->format($format, $format_settings);
-    $this->assertIdentical($input_value, $output_value);
-  }
-
-}
diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php
index 8f69047d411f..ff9da9479372 100644
--- a/core/modules/system/src/Tests/System/DateTimeTest.php
+++ b/core/modules/system/src/Tests/System/DateTimeTest.php
@@ -132,7 +132,7 @@ function testDateFormatXSS() {
     $date_format = entity_create('date_format', array(
       'id' => 'xss_short',
       'label' => 'XSS format',
-      'pattern' => array('php' => '\<\s\c\r\i\p\t\>\a\l\e\r\t\(\'\X\S\S\'\)\;\<\/\s\c\r\i\p\t\>'),
+      'pattern' => '\<\s\c\r\i\p\t\>\a\l\e\r\t\(\'\X\S\S\'\)\;\<\/\s\c\r\i\p\t\>',
     ));
     $date_format->save();
 
diff --git a/core/modules/system/tests/themes/test_basetheme/config/install/system.date_format.fancy.yml b/core/modules/system/tests/themes/test_basetheme/config/install/system.date_format.fancy.yml
index 12ae88611714..37a0bf83ec5e 100644
--- a/core/modules/system/tests/themes/test_basetheme/config/install/system.date_format.fancy.yml
+++ b/core/modules/system/tests/themes/test_basetheme/config/install/system.date_format.fancy.yml
@@ -6,6 +6,4 @@ label: 'Fancy date'
 status: true
 langcode: en
 locked: false
-pattern:
-  php: 'U'
-  intl: 'EEEE, LLLL d, yyyy - kk:mm'
+pattern: 'U'
-- 
GitLab