From 8f2fc012316607f60fe78cbd6f9d19507a2abefa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 5 Dec 2011 15:39:56 +0100 Subject: [PATCH] Add formatted time for display in template --- file/lib/data/chat/message/ChatMessage.class.php | 3 ++- template/chatMessage.tpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/file/lib/data/chat/message/ChatMessage.class.php b/file/lib/data/chat/message/ChatMessage.class.php index 4731cac..3e8f2a1 100644 --- a/file/lib/data/chat/message/ChatMessage.class.php +++ b/file/lib/data/chat/message/ChatMessage.class.php @@ -94,9 +94,10 @@ public function jsonify() { return \wcf\util\JSON::encode(array( 'formattedUsername' => $this->getFormattedUsername(), 'formattedMessage' => $this->getFormattedMessage(), - 'time' => $this->time, + 'formattedTime' => \wcf\util\DateUtil::format(\wcf\util\DateUtil::getDateTimeByTimestamp($this->time), 'H:i:s'), 'sender' => $this->sender, 'username' => $this->getUsername(), + 'time' => $this->time, 'receiver' => $this->receiver, 'type' => $this->type )); diff --git a/template/chatMessage.tpl b/template/chatMessage.tpl index 18fa9af..8a8dcbb 100644 --- a/template/chatMessage.tpl +++ b/template/chatMessage.tpl @@ -1 +1 @@ -{literal}{@$time} {@$formattedUsername}{@$formattedMessage}{/literal} +{literal}{@$formattedTime} {@$formattedUsername}{@$formattedMessage}{/literal}