chore: use seconds timestamp system
This commit is contained in:
parent
4cd0e63029
commit
b81b008a93
@ -71,7 +71,7 @@ export abstract class OAIEngine extends AIEngine {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const timestamp = Date.now()
|
const timestamp = Date.now() / 1000
|
||||||
const message: ThreadMessage = {
|
const message: ThreadMessage = {
|
||||||
id: ulid(),
|
id: ulid(),
|
||||||
thread_id: data.threadId,
|
thread_id: data.threadId,
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export default class JanAssistantExtension extends AssistantExtension {
|
|||||||
thread_location: undefined,
|
thread_location: undefined,
|
||||||
id: 'jan',
|
id: 'jan',
|
||||||
object: 'assistant',
|
object: 'assistant',
|
||||||
created_at: Date.now(),
|
created_at: Date.now() / 1000,
|
||||||
name: 'Jan',
|
name: 'Jan',
|
||||||
description: 'A default assistant that can use all downloaded models',
|
description: 'A default assistant that can use all downloaded models',
|
||||||
model: '*',
|
model: '*',
|
||||||
|
|||||||
@ -91,7 +91,8 @@ const MessageContainer: React.FC<
|
|||||||
: (activeAssistant?.assistant_name ?? props.role)}
|
: (activeAssistant?.assistant_name ?? props.role)}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs font-medium text-gray-400">
|
<p className="text-xs font-medium text-gray-400">
|
||||||
{props.created_at && displayDate(props.created_at ?? new Date())}
|
{props.created_at &&
|
||||||
|
displayDate(props.created_at ?? Date.now() / 1000)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
export const isToday = (timestamp: number) => {
|
export const isToday = (timestamp: number) => {
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
return today.setHours(0, 0, 0, 0) === new Date(timestamp).setHours(0, 0, 0, 0)
|
return (
|
||||||
|
today.setHours(0, 0, 0, 0) ===
|
||||||
|
new Date(timestamp * 1000).setHours(0, 0, 0, 0)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const displayDate = (timestamp?: string | number | Date) => {
|
export const displayDate = (timestamp?: string | number | Date) => {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import { ulid } from 'ulidx'
|
|||||||
|
|
||||||
import { Stack } from '@/utils/Stack'
|
import { Stack } from '@/utils/Stack'
|
||||||
|
|
||||||
import { FileInfo, FileType } from '@/types/file'
|
import { FileInfo } from '@/types/file'
|
||||||
|
|
||||||
export class MessageRequestBuilder {
|
export class MessageRequestBuilder {
|
||||||
msgId: string
|
msgId: string
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class ThreadMessageBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build(): ThreadMessage {
|
build(): ThreadMessage {
|
||||||
const timestamp = Date.now()
|
const timestamp = Date.now() / 1000
|
||||||
return {
|
return {
|
||||||
id: this.messageRequest.msgId,
|
id: this.messageRequest.msgId,
|
||||||
thread_id: this.messageRequest.thread.id,
|
thread_id: this.messageRequest.thread.id,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user