aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/template
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-09-17 09:39:27 +0200
committerGitHub <noreply@github.com>2024-09-17 09:39:27 +0200
commitc256518ab3cb61d046ee10edf1c3b18218ee8ff6 (patch)
tree1d60d3501d5f14f8f9e136e98bcc4b395d621f66 /lib/private/legacy/template
parent6c7d79b6960813d36dbad51f6fb74a6adaf75c4d (diff)
parentc2443ad1f223f0846dd138f03c2e52665a1b8345 (diff)
downloadnextcloud-server-c256518ab3cb61d046ee10edf1c3b18218ee8ff6.tar.gz
nextcloud-server-c256518ab3cb61d046ee10edf1c3b18218ee8ff6.zip
Merge pull request #48110 from nextcloud/chore/remove-deprecated-aliases
chore: Remove deprecated aliases from dependency injection
Diffstat (limited to 'lib/private/legacy/template')
-rw-r--r--lib/private/legacy/template/functions.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php
index 87b91639fd3..a9a1f10a116 100644
--- a/lib/private/legacy/template/functions.php
+++ b/lib/private/legacy/template/functions.php
@@ -5,6 +5,8 @@
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
+
+use OCP\IDateTimeFormatter;
use OCP\Util;
function p($string) {
@@ -280,9 +282,8 @@ function strip_time($timestamp) {
* @param bool|null $dateOnly whether to strip time information
* @return string timestamp
*/
-function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) {
- /** @var \OC\DateTimeFormatter $formatter */
- $formatter = \OCP\Server::get('DateTimeFormatter');
+function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false): string {
+ $formatter = \OCP\Server::get(IDateTimeFormatter::class);
if ($dateOnly) {
return $formatter->formatDateSpan($timestamp, $fromTime);