]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: Getting default timezone for local time 49087/head
authorAndrii <a.ilkiv.ye@gmail.com>
Tue, 5 Nov 2024 04:56:04 +0000 (06:56 +0200)
committerAndrii Ilkiv <a.ilkiv.ye@gmail.com>
Tue, 5 Nov 2024 17:56:41 +0000 (19:56 +0200)
Signed-off-by: Andrii Ilkiv <a.ilkiv.ye@gmail.com>
lib/private/Contacts/ContactsMenu/Providers/LocalTimeProvider.php

index a5d911a03b17d7aff199f8467c9410090573826e..b51ade4d74da32aed466714630af6879ba344b64 100644 (file)
@@ -35,7 +35,7 @@ class LocalTimeProvider implements IProvider {
                $targetUserId = $entry->getProperty('UID');
                $targetUser = $this->userManager->get($targetUserId);
                if (!empty($targetUser)) {
-                       $timezone = $this->config->getUserValue($targetUser->getUID(), 'core', 'timezone') ?: date_default_timezone_get();
+                       $timezone = $this->config->getUserValue($targetUser->getUID(), 'core', 'timezone') ?: $this->config->getSystemValueString('default_timezone', 'UTC');
                        $dateTimeZone = new \DateTimeZone($timezone);
                        $localTime = $this->dateTimeFormatter->formatTime($this->timeFactory->getDateTime(), 'short', $dateTimeZone);