"backend/vscode:/vscode.git/clone" did not exist on "3978efd7104cbaf21ad054080e694f8919f1b306"
Commit 4ec81a89 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: message ts display

parent 59724ea9
<div class=" self-center font-bold mb-0.5 capitalize">
<div class=" self-center font-bold mb-0.5 capitalize line-clamp-1">
<slot />
</div>
<script lang="ts">
import dayjs from 'dayjs';
import { marked } from 'marked';
import tippy from 'tippy.js';
......@@ -219,6 +220,12 @@
>{message.model ? ` ${message.model}` : ''}</span
>
{/if}
{#if message.timestamp}
<span class=" invisible group-hover:visible text-gray-400 text-xs font-normal">
{dayjs(message.timestamp * 1000).format('DD/MM/YYYY HH:MM')}
</span>
{/if}
</Name>
{#if message.content === ''}
......
<script lang="ts">
import dayjs from 'dayjs';
import { tick } from 'svelte';
import Name from './Name.svelte';
import ProfileImage from './ProfileImage.svelte';
......@@ -61,6 +63,12 @@
{:else}
You
{/if}
{#if message.timestamp}
<span class=" invisible group-hover:visible text-gray-400 text-xs font-normal">
{dayjs(message.timestamp * 1000).format('DD/MM/YYYY HH:MM')}
</span>
{/if}
</Name>
</div>
......
......@@ -146,7 +146,7 @@
user: _user ?? undefined,
content: userPrompt,
files: files.length > 0 ? files : undefined,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
// Add message to history and Set currentId to messageId
......@@ -258,7 +258,7 @@
role: 'assistant',
content: '',
model: model,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
// Add message to history and Set currentId to messageId
......@@ -449,7 +449,7 @@
role: 'assistant',
content: '',
model: model,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
history.messages[responseMessageId] = responseMessage;
......
......@@ -165,7 +165,7 @@
user: _user ?? undefined,
content: userPrompt,
files: files.length > 0 ? files : undefined,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
// Add message to history and Set currentId to messageId
......@@ -276,7 +276,7 @@
role: 'assistant',
content: '',
model: model,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
// Add message to history and Set currentId to messageId
......@@ -467,7 +467,7 @@
role: 'assistant',
content: '',
model: model,
timestamp: Date.now()
timestamp: Math.floor(Date.now() / 1000) // Unix epoch
};
history.messages[responseMessageId] = responseMessage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment