diff -u b/core/lib/Drupal/Core/Datetime/DateFormatter.php b/core/lib/Drupal/Core/Datetime/DateFormatter.php --- b/core/lib/Drupal/Core/Datetime/DateFormatter.php +++ b/core/lib/Drupal/Core/Datetime/DateFormatter.php @@ -129,7 +129,7 @@ * (optional) Language code to translate to. NULL (default) means to use * the user interface language for the page. * - * @return string + * @return string|\Drupal\Component\Utility\SafeStringInterface * A translated date string in the requested format. Since the format may * contain user input, this value should be escaped when output. */ diff -u b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php --- b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php +++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php @@ -89,7 +89,7 @@ * - langcode: (optional) String two letter language code used to control * the result of the format() method. Defaults to NULL. * - * @return string + * @return string|\Drupal\Component\Utility\SafeStringInterface * The formatted value of the date. Since the format may contain user input, * this value should be escaped when output. */ diff -u b/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php --- b/core/modules/system/src/Tests/System/DateTimeTest.php +++ b/core/modules/system/src/Tests/System/DateTimeTest.php @@ -135,7 +135,6 @@ $this->assertText($name, 'Custom date format appears in the date format list.'); $this->assertText(t('Delete'), 'Delete link for custom date format appears.'); - // $date_format = entity_create('date_format', array( 'id' => 'xss_short', 'label' => 'XSS format',