From d18ec187847893f94418b29bc6a087d6b2dd9a2d Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 7 Feb 2025 18:26:05 +0000 Subject: localise note timestamps and stuff --- templates/note.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'templates/note.php') diff --git a/templates/note.php b/templates/note.php index b43e63e..db4fbb9 100644 --- a/templates/note.php +++ b/templates/note.php @@ -3,8 +3,10 @@ use Digitigrade\Model\Actor; use Digitigrade\Model\InteractionKind; use Digitigrade\Model\NotePrivacyScope; use Digitigrade\Model\UserAccount; +use Digitigrade\UserSettings; $user = UserAccount::findByCurrentSession(); +$prefs = $user ? new UserSettings($user) : null; $interKinds = []; $actionsDisabled = $user == null; if ($user != null) { @@ -25,13 +27,11 @@ if ($user != null) { href="/@/author->getFullHandle() ?>">author->displayName) ?> @author->getFullHandle() ?> - created->format('Y-m-d \a\t H:i') + created, $prefs?->get('locale.timezone')) . (isset($note->modified) && $note->modified != $note->created - ? ' (edited ' . $note->modified->format('Y-m-d \a\t H:i') . ')' + ? ' (' . format_datetime($note->modified, $prefs?->get('locale.timezone')) . ')' : '' - ) - ?> + ) ?> attachments as $attachment): ?>
- type, 'image/')): ?> + isImage()): ?> <?= htmlspecialchars($attachment->description ?? '') ?> - + description ?? basename($attachment->href)) ?> -- cgit v1.3