From b41772455dcad66b92f1365444001471a9e3dca9 Mon Sep 17 00:00:00 2001 From: luo Date: Tue, 29 Sep 2026 17:43:16 +0800 Subject: [PATCH] fix:timeformate --- .../core/layouts/art-chat-window/index.vue | 3 +- .../comment-widget/widget/CommentItem.vue | 6 +-- src/types/components.d.ts | 5 +- src/utils/business/format.ts | 49 ++++++++++++++----- src/utils/dataprocess/format.ts | 5 +- .../components/BasicInfoCard.vue | 43 +++------------- 6 files changed, 52 insertions(+), 59 deletions(-) diff --git a/src/components/core/layouts/art-chat-window/index.vue b/src/components/core/layouts/art-chat-window/index.vue index b4dcd0c..87ad5b3 100644 --- a/src/components/core/layouts/art-chat-window/index.vue +++ b/src/components/core/layouts/art-chat-window/index.vue @@ -69,6 +69,7 @@ import { ref, onMounted } from 'vue' import { Picture, Paperclip } from '@element-plus/icons-vue' import { mittBus } from '@/utils/sys' + import { formatDateTime } from '@/utils/business/format' const { width } = useWindowSize() const isMobile = computed(() => width.value < 500) @@ -157,7 +158,7 @@ id: messageId.value++, sender: 'Ricky', content: text, - time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }), + time: formatDateTime(new Date(), 'HH:mm'), isMe: true }) diff --git a/src/components/custom/comment-widget/widget/CommentItem.vue b/src/components/custom/comment-widget/widget/CommentItem.vue index 8ce38a3..04bf441 100644 --- a/src/components/custom/comment-widget/widget/CommentItem.vue +++ b/src/components/custom/comment-widget/widget/CommentItem.vue @@ -37,6 +37,7 @@