diff -u b/core/lib/Drupal/Core/Datetime/Element/Datetime.php b/core/lib/Drupal/Core/Datetime/Element/Datetime.php --- b/core/lib/Drupal/Core/Datetime/Element/Datetime.php +++ b/core/lib/Drupal/Core/Datetime/Element/Datetime.php @@ -377,4 +377,27 @@ /** + * Creates an example for a date format. + * + * This is centralized for a consistent method of creating these examples. + * + * @param string $format + * The date format. + * + * @return string + * + * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. HTML date + * input format should not be exposed to users, as browser widgets expose + * input differently, varying by vendor, locale, device type, etc. + * @see https://www.drupal.org/project/drupal/issues/2791693 + */ + public static function formatExample($format) { + @trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. No replacement provided. https://www.drupal.org/project/drupal/issues/2791693', E_USER_DEPRECATED); + if (!static::$dateExample) { + static::$dateExample = new DrupalDateTime(); + } + return static::$dateExample->format($format); + } + + /** * Retrieves the right format for an HTML5 date element. *