feat: Display received time and fix timestamp timezone conversion.
This commit is contained in:
@@ -30,7 +30,7 @@ app.get('/api/messages', async (req, res) => {
|
||||
|
||||
try {
|
||||
const [rows] = await db.execute(
|
||||
'SELECT id, sender, recipient, subject, body, received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
|
||||
'SELECT id, sender, recipient, subject, body, CAST(received_at AS CHAR) as received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
|
||||
[`%${recipient}%`]
|
||||
);
|
||||
res.json(rows);
|
||||
|
||||
@@ -24,6 +24,7 @@ const messages = {
|
||||
selectMail: '请从选择一封邮件查看',
|
||||
from: '发件人',
|
||||
to: '收件人',
|
||||
received_at: '收件时间',
|
||||
attachments: '附件',
|
||||
delete: '删除',
|
||||
clearInbox: '清空收件箱',
|
||||
@@ -68,6 +69,7 @@ const messages = {
|
||||
selectMail: 'Please select an email to view',
|
||||
from: 'From',
|
||||
to: 'To',
|
||||
received_at: 'Received At',
|
||||
attachments: 'Attachments',
|
||||
delete: 'Delete',
|
||||
clearInbox: 'Clear Inbox',
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<h3>{{ selectedMessage.subject }}</h3>
|
||||
<p class="from-line"><strong>{{ $t('home.from') }}:</strong> {{ selectedMessage.sender }}</p>
|
||||
<p><strong>{{ $t('home.to') }}:</strong> {{ selectedMessage.recipient }}</p>
|
||||
<p><strong>{{ $t('home.received_at') }}:</strong> {{ selectedMessage.received_at }}</p>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button @click="deleteMessage(selectedMessage.id)" :title="$t('home.delete')">
|
||||
|
||||
Reference in New Issue
Block a user