diff --git a/acptemplate/__messageLogTable.tpl b/acptemplate/__messageLogTable.tpl
index 157f124..821cbb6 100644
--- a/acptemplate/__messageLogTable.tpl
+++ b/acptemplate/__messageLogTable.tpl
@@ -13,7 +13,7 @@
{foreach from=$messages item="message"}
{$message->messageID} |
- {$message->time|date:"H:i:s"} |
+ {$message->time|date:"chat.global.timeFormat"} |
{@$message->getUserProfile()->getAvatar()->getImageTag(24)} |
{$message->username} |
{@$message->getFormattedMessage("text/simplified-html")} |
diff --git a/acptemplate/messageLogDownload.tpl b/acptemplate/messageLogDownload.tpl
index cbfa157..dd12fcc 100644
--- a/acptemplate/messageLogDownload.tpl
+++ b/acptemplate/messageLogDownload.tpl
@@ -1,5 +1,5 @@
{foreach from=$messages item=$rawMessage}{*
*}{assign var=message value=$rawMessage->jsonify(true)}{*
- *}({$message['time']|date:'H:i:s'}) {$message[username]|str_pad:15:' ':STR_PAD_LEFT}{$message[separator]} {$message[message]}
+ *}({$message['time']|date:'chat.global.timeFormat'}) {$message[username]|str_pad:15:' ':STR_PAD_LEFT}{$message[separator]} {$message[message]}
{/foreach}
diff --git a/file/lib/data/message/Message.class.php b/file/lib/data/message/Message.class.php
index f97f794..ccceb0c 100644
--- a/file/lib/data/message/Message.class.php
+++ b/file/lib/data/message/Message.class.php
@@ -153,10 +153,12 @@ public function jsonify($raw = false) {
break;
}
+ $time = \wcf\util\DateUtil::getDateTimeByTimestamp($this->time);
+ $startOfDay = new \DateTime('today', WCF::getUser()->getTimezone());
$array = array(
'formattedUsername' => $this->getUsername(true),
'formattedMessage' => $this->getFormattedMessage('text/html'),
- 'formattedTime' => \wcf\util\DateUtil::format(\wcf\util\DateUtil::getDateTimeByTimestamp($this->time), 'H:i:s'),
+ 'formattedTime' => ($time->getTimestamp() < $startOfDay->getTimestamp() ? \wcf\util\DateUtil::format($time, 'chat.global.dateFormat').' ' : '').\wcf\util\DateUtil::format($time, 'chat.global.timeFormat'),
'separator' => $separator,
'message' => $this->getFormattedMessage('text/plain'),
'sender' => (int) $this->sender,
diff --git a/language/de.xml b/language/de.xml
index 7a23b6e..2b76555 100644
--- a/language/de.xml
+++ b/language/de.xml
@@ -193,6 +193,9 @@ Probieren Sie, den Chat neu zu laden