From: Cyperghost Date: Tue, 19 Dec 2023 11:05:13 +0000 (+0100) Subject: Use intl to format date X-Git-Tag: 6.0.4~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32ced800583830d4311830d884ef60bbeccef63a;p=GitHub%2FWoltLab%2FWCF.git Use intl to format date --- diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index 7213c1b806..493b91b4e8 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -191,15 +191,12 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio $dateTime = DateUtil::getDateTimeByTimestamp($nextExec); $return[$cronjob->cronjobID] = [ 'time' => $nextExec, - 'formatted' => \str_replace( - '%time%', - DateUtil::format($dateTime, DateUtil::TIME_FORMAT), - \str_replace( - '%date%', - DateUtil::format($dateTime, DateUtil::DATE_FORMAT), - WCF::getLanguage()->get('wcf.date.dateTimeFormat') - ) - ), + 'formatted' => \IntlDateFormatter::create( + WCF::getLanguage()->getLocale(), + \IntlDateFormatter::LONG, + \IntlDateFormatter::SHORT, + WCF::getUser()->getTimeZone() + )->format($dateTime), ]; }