feat(frontend): add time manager and unify date formats

This commit is contained in:
Tim
2025-07-09 18:48:06 +08:00
parent 9867ed91f4
commit 52ae87e4f4
6 changed files with 45 additions and 8 deletions

View File

@@ -102,6 +102,7 @@
import { ref, onMounted } from 'vue'
import { stripMarkdown } from '../utils/markdown'
import { API_BASE_URL } from '../main'
import TimeManager from '../utils/time'
import CategorySelect from '../components/CategorySelect.vue'
import TagSelect from '../components/TagSelect.vue'
import ArticleTags from '../components/ArticleTags.vue'
@@ -152,7 +153,7 @@ export default {
members: [],
comments: (p.comments || []).length,
views: p.views,
time: new Date(p.createdAt).toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })
time: TimeManager.format(p.createdAt)
}))
)
if (data.length < pageSize) {