Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-09-22 18:30:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6faf107c76a98c1efb8b3370a3766ecfc96ce278
6faf107c
1 parent
088f283e
fix(FeedbackList): 修复日期格式显示问题,改用12小时制并添加上午/下午标识
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
src/pages/FeedbackList/index.vue
src/pages/FeedbackList/index.vue
View file @
6faf107
...
...
@@ -178,13 +178,19 @@ const loadMore = () => {
const formatDate = (dateString) => {
if (!dateString) return '';
const date = new Date(dateString);
return date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit'
});
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = date.getHours();
const minutes = String(date.getMinutes()).padStart(2, '0');
// 判断上午下午
const period = hours < 12 ? '上午' : '下午';
// 转换为12小时制
const displayHours = String(hours % 12 || 12).padStart(2, '0');
return `${year}-${month}-${day} ${period}${displayHours}:${minutes}`;
};
/**
...
...
Please
register
or
login
to post a comment