feat: Display received time and fix timestamp timezone conversion.

This commit is contained in:
shenjianZ 2025-08-02 11:26:41 +08:00
parent e936fbc140
commit d57037781e
3 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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',

View File

@ -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')">