mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-08-02 05:59:33 +08:00
chore: import locale from dayjs
This commit is contained in:
@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { toast } from "react-hot-toast";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import { useConversationStore, useConnectionStore, useMessageStore, useUserStore } from "@/store";
|
||||
import { useConversationStore, useConnectionStore, useMessageStore, useUserStore, useSettingStore } from "@/store";
|
||||
import { Message } from "@/types";
|
||||
import Icon from "../Icon";
|
||||
import { CodeBlock } from "../CodeBlock";
|
||||
@ -19,6 +19,7 @@ interface Props {
|
||||
const MessageView = (props: Props) => {
|
||||
const message = props.message;
|
||||
const { t } = useTranslation();
|
||||
const settingStore = useSettingStore();
|
||||
const userStore = useUserStore();
|
||||
const conversationStore = useConversationStore();
|
||||
const connectionStore = useConnectionStore();
|
||||
@ -106,7 +107,9 @@ const MessageView = (props: Props) => {
|
||||
>
|
||||
{message.content}
|
||||
</ReactMarkdown>
|
||||
<span className="self-end text-sm text-gray-400 pt-1 pr-1">{dayjs(message.createdAt).format("lll")}</span>
|
||||
<span className="self-end text-sm text-gray-400 pt-1 pr-1">
|
||||
{dayjs(message.createdAt).locale(settingStore.setting.locale).format("lll")}
|
||||
</span>
|
||||
</div>
|
||||
<div className={`invisible group-hover:visible ${showMenu && "!visible"}`}>
|
||||
<button
|
||||
|
@ -5,9 +5,11 @@ import { AppProps } from "next/app";
|
||||
import React, { useEffect } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
dayjs.extend(localizedFormat);
|
||||
import { useSettingStore } from "@/store";
|
||||
|
||||
dayjs.extend(localizedFormat);
|
||||
import "dayjs/locale/zh";
|
||||
|
||||
import "@/locales/i18n";
|
||||
import "@/styles/tailwind.css";
|
||||
import "@/styles/global.css";
|
||||
|
Reference in New Issue
Block a user