From d6b38bf26bce81c6fe3f3aa7b3bf35fd5a5106ac Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Tue, 29 Oct 2024 14:17:21 +0100 Subject: [PATCH] Use `\DateTime::format()` instead of `DateUtil::format()` --- .../template/plugin/DateModifierTemplatePlugin.class.php | 6 +----- wcfsetup/install/files/lib/util/DateUtil.class.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/template/plugin/DateModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/DateModifierTemplatePlugin.class.php index 5210ab12c0..9d1718f884 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/DateModifierTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/DateModifierTemplatePlugin.class.php @@ -4,7 +4,6 @@ namespace wcf\system\template\plugin; use wcf\system\template\TemplateEngine; use wcf\system\WCF; -use wcf\util\DateUtil; /** * Template modifier plugin which renders a \DateTimeInterface or @@ -37,10 +36,7 @@ class DateModifierTemplatePlugin implements IModifierTemplatePlugin } if (!empty($tagArgs[1])) { - return DateUtil::format( - $dateTime, - $tagArgs[1] - ); + return $dateTime->format($tagArgs[1]); } else { $locale = WCF::getLanguage()->getLocale(); $timeZone = WCF::getUser()->getTimeZone(); diff --git a/wcfsetup/install/files/lib/util/DateUtil.class.php b/wcfsetup/install/files/lib/util/DateUtil.class.php index f4f9340128..96d59fa743 100644 --- a/wcfsetup/install/files/lib/util/DateUtil.class.php +++ b/wcfsetup/install/files/lib/util/DateUtil.class.php @@ -178,7 +178,7 @@ final class DateUtil * @param User $user * @return string * - * @deprecated 6.2 use `\IntlDateFormatter` instead + * @deprecated 6.2 use `\IntlDateFormatter` or `\DateTime::format()` instead */ public static function format( null|\DateTime|\DateTimeImmutable $time = null, -- 2.20.1